1# $NetBSD: TODO,v 1.5 2001/07/13 20:30:22 perseant Exp $ 2 3- Investigate alternate inode locking strategy: Inode locks are useful 4 for locking against simultaneous changes to inode size (balloc, 5 truncate, write) but because the assignment of disk blocks is also 6 covered by the segment lock, we don't really need to pay attention to 7 the inode lock when writing a segment, right? If this is true, the 8 locking problem in lfs_{bmapv,markv} goes away and lfs_reserve can go, 9 too. 10 11- Fully working fsck_lfs. (Really, need a general-purpose external 12 partial-segment writer.) 13 14- Inode blocks are currently the same size as the fs block size; but all 15 the ones I've seen are mostly empty, and this will be especially true 16 if atime information is kept in the ifile instead of the inode. Could 17 we shrink the inode block size to DEV_BSIZE? Or parametrize it at fs 18 creation time? 19 20- Get rid of DEV_BSIZE, pay attention to the media block size at mount time. 21 22- More fs ops need to call lfs_imtime. Which ones? (Blackwell et al., 1995) 23 24- lfs_vunref_head exists so that vnodes loaded solely for cleaning can 25 be put back on the *head* of the vnode free list. Make sure we 26 actually do this, since we now take IN_CLEANING off during segment write. 27 28- The cleaner could be enhanced to be controlled from other processes, 29 and possibly perform additional tasks: 30 31 - Backups. At a minimum, turn the cleaner off and on to allow 32 effective live backups. More aggressively, the cleaner itself could 33 be the backup agent, and dump_lfs would merely be a controller. 34 35 - Cleaning time policies. Be able to tweak the cleaner's thresholds 36 to allow more thorough cleaning during policy-determined idle 37 periods (regardless of actual idleness) or put off until later 38 during short, intensive write periods. 39 40 - File coalescing and placement. During periods we expect to be idle, 41 coalesce fragmented files into one place on disk for better read 42 performance. Ideally, move files that have not been accessed in a 43 while to the extremes of the disk, thereby shortening seek times for 44 files that are accessed more frequently (though how the cleaner 45 should communicate "please put this near the beginning or end of the 46 disk" to the kernel is a very good question; flags to lfs_markv?). 47 48 - Versioning. When it cleans a segment it could write data for files 49 that were less than n versions old to tape or elsewhere. Perhaps it 50 could even write them back onto the disk, although that requires 51 more thought (and kernel mods). 52 53- Move lfs_countlocked() into vfs_bio.c, to replace count_locked_queue; 54 perhaps keep the name, replace the function. Could it count referenced 55 vnodes as well, if it was in vfs_subr.c instead? 56 57- Why not delete the lfs_bmapv call, just mark everything dirty that 58 isn't deleted/truncated? Get some numbers about what percentage of 59 the stuff that the cleaner thinks might be live is live. If it's 60 high, get rid of lfs_bmapv. 61 62- There is a nasty problem in that it may take *more* room to write the 63 data to clean a segment than is returned by the new segment because of 64 indirect blocks in segment 2 being dirtied by the data being copied 65 into the log from segment 1. The suggested solution at this point is 66 to detect it when we have no space left on the filesystem, write the 67 extra data into the last segment (leaving no clean ones), make it a 68 checkpoint and shut down the file system for fixing by a utility 69 reading the raw partition. Argument is that this should never happen 70 and is practically impossible to fix since the cleaner would have to 71 theoretically build a model of the entire filesystem in memory to 72 detect the condition occurring. A file coalescing cleaner will help 73 avoid the problem, and one that reads/writes from the raw disk could 74 fix it. 75 76- Need to keep vnode v_numoutput up to date for pending writes? 77 78- If delete a file that's being executed, the version number isn't 79 updated, and fsck_lfs has to figure this out; case is the same as if 80 have an inode that no directory references, so the file should be 81 reattached into lost+found. 82 83- Currently there's no notion of write error checking. 84 + Failed data/inode writes should be rescheduled (kernel level bad blocking). 85 + Failed superblock writes should cause selection of new superblock 86 for checkpointing. 87 88- Future fantasies: 89 - unrm, versioning 90 - transactions 91 - extended cleaner policies (hot/cold data, data placement) 92 93- Problem with the concept of multiple buffer headers referencing the segment: 94 Positives: 95 Don't lock down 1 segment per file system of physical memory. 96 Don't copy from buffers to segment memory. 97 Don't tie down the bus to transfer 1M. 98 Works on controllers supporting less than large transfers. 99 Disk can start writing immediately instead of waiting 1/2 rotation 100 and the full transfer. 101 Negatives: 102 Have to do segment write then segment summary write, since the latter 103 is what verifies that the segment is okay. (Is there another way 104 to do this?) 105 106- The algorithm for selecting the disk addresses of the super-blocks 107 has to be available to the user program which checks the file system. 108