Linux 2.6.6 changes

From: Gregory Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Linux 2.6.6 changes
Date: 2004-05-10 14:58:13
Message-ID: 87ad0gs516.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


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?

<akpm(at)osdl(dot)org>
[PATCH] ext3 fsync() and fdatasync() speedup

ext3's fsync/fdatasync implementation is currently syncing the inode via a
full journal commit even if it was unaltered.

Fix that up by exporting the core VFS's inode sync function to modules and
calling it if the inode is dirty. We need to do it this way so that the
inode is moved to the appropriate superblock list and so that the i_state
dirty flags are appropriately updated.

This speeds up ext3 fsync() for file overwrites by a factor of four (disk
non-writeback) to forty (disk in writeback mode).

<akpm(at)osdl(dot)org>
[PATCH] speed up ext2 fsync() and fdatasync()

ext2_sync_file() forgets to clear the inode's dirty bits, so we write the
inode on every fsync(), even if it hasn't changed.

Fix that up via the new sync_file() API which correctly manages the inode
state bits and the superblock inode lists.

When performing file overwrite on IDE with and without writeback caching
enabled this patch approximately doubles fsync() speed, bringing it into line
with O_SYNC writes.

Also, fix up the return value handling in ext2_sync_file().

Credit due to Jeffrey Siegal <jbs(at)quiotix(dot)com> who noticed the performance
discrepancy and wrote a test app.

--
greg

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2004-05-10 15:26:41 Linux 2.6.6 also
Previous Message Christopher Kings-Lynne 2004-05-10 14:48:56 Bug in renaming view columns