Bug 445649 - [PATCH][RHEL5.1] Performance Improvement of fdatasync(2) in case of Overwrite
Summary: [PATCH][RHEL5.1] Performance Improvement of fdatasync(2) in case of Overwrite
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.1
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Josef Bacik
QA Contact: Martin Jenner
URL: http://git.kernel.org/?p=linux/kernel...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-05-08 10:02 UTC by Masaki MAENO
Modified: 2009-01-20 20:23 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-20 20:23:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed patch (416 bytes, patch)
2008-05-19 15:35 UTC, Josef Bacik
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:0225 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.3 kernel security and bug fix update 2009-01-20 16:06:24 UTC

Description Masaki MAENO 2008-05-08 10:02:46 UTC
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)

Comment 1 Josef Bacik 2008-05-19 15:34:08 UTC
Fixing summary as this is the RHEL5 specific bug.

Comment 2 Josef Bacik 2008-05-19 15:35:06 UTC
Created attachment 305962 [details]
proposed patch

Here is the RHEL5 version of this patch.

Comment 4 RHEL Program Management 2008-06-06 15:44:45 UTC
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.

Comment 5 Don Zickus 2008-07-23 18:55:39 UTC
in kernel-2.6.18-99.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Comment 10 errata-xmlrpc 2009-01-20 20:23:19 UTC
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


Note You need to log in before you can comment on or make changes to this bug.