Description of problem and Proposal of improvement: In the kernel implementation of RHEL4 or RHEL5, Even if fdatasync(2) is used, it always becomes considerable fsync(2). fdatasync(2) (that contains only the overwrite) becomes high-speed by not synchronizing the inode in only case of overwrite which the meta-data doesn't change. Then, I propose the following patches. The patch can be easily applied even by RHEL4 and RHEL5. It has already been taken into Vanilla-kernel. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=3d61f75eefedf75914ab4453c67aaa2ee64bcf93;hp=8b91582500ae750db22bd515379616e5e9ad06ab > > --- a/fs/ext3/fsync.c > > +++ b/fs/ext3/fsync.c > > @@ -72,6 +72,9 @@ int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync) > > goto out; > > } > > > > + if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) > > + goto out; > > + > > /* > > * The VFS has written the file data. If the inode is unaltered > > * then we need not start a commit. Additional info: For PostgreSQL, the patch has a dramatic effect on to the performance gain. Because fdatasync(2) is executed the following steps: 1. Enhance the transaction log file (= WAL) by 0 padding. 2. Write the contents of transaction. 3. Synchronize by executing fdatasync(2) per a transaction. Please take it by the following update! (RHEL5.2 or 5.3, RHEL4.7 or 4.8)
Fixing summary as this is the RHEL5 specific bug.
Created attachment 305962 [details] proposed patch Here is the RHEL5 version of this patch.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
in kernel-2.6.18-99.el5 You can download this test kernel from http://people.redhat.com/dzickus/el5
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2009-0225.html