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