Linux 2.6.6 changes
Linux 2.6.6 changes
От:
Gregory Stark <gsstark@mit.edu>
Дата:
I'm not sure how important these changes are, but perhaps we'll find fsync faster than O_SYNC on linux 2.6.6 where O_SYNC was faster before? [PATCH] ext3 fsync() and fdatasync() speedupext3's fsync/fdatasync implementation is currently syncing the inode via afull journal commit even if it was unaltered.Fix that up by exporting the core VFS's inode sync function to modules andcalling it if the inode is dirty. We need to do it this way so that theinode is moved to the appropriate superblock list and so that the i_statedirty flags are appropriately updated.This speeds up ext3 fsync() for file overwrites by a factor of four (disknon-writeback) to forty (disk in writeback mode). [PATCH] speed up ext2 fsync() and fdatasync()ext2_sync_file() forgets to clear the inode's dirty bits, so we write theinode on every fsync(), even if it hasn't changed.Fix that up via the new sync_file() API which correctly manages the inodestate bits and the superblock inode lists.When performing file overwrite on IDE with and without writeback cachingenabled this patch approximately doubles fsync() speed, bringing it into linewith O_SYNC writes.Also, fix up the return value handling in ext2_sync_file().Credit due to Jeffrey Siegal who noticed the performancediscrepancy and wrote a test app. -- greg