| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | [PATCH] xfs: optimize log flushing in xfs_fsync |
| From: | Christoph Hellwig <hch@xxxxxxxxxxxxx> |
| Date: | Fri, 5 Feb 2010 04:57:55 -0500 |
| User-agent: | Mutt/1.5.19 (2009-01-05) |
If we have a pinned inode it must have a log item attached to it.
Usually that log item will have ili_last_lsn already set, in which
case we only need to flush the log up to that LSN instead of doing
a full log force. This gives speedups of about 5% in some fsync
heavy workloads.
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
Index: xfs/fs/xfs/xfs_vnodeops.c
===================================================================
--- xfs.orig/fs/xfs/xfs_vnodeops.c 2010-02-04 17:38:33.679254119 +0100
+++ xfs/fs/xfs/xfs_vnodeops.c 2010-02-04 17:38:51.606006156 +0100
@@ -626,8 +626,14 @@ xfs_fsync(
* force the log.
*/
if (xfs_ipincount(ip)) {
- error = _xfs_log_force(ip->i_mount, XFS_LOG_SYNC,
- &log_flushed);
+ if (ip->i_itemp->ili_last_lsn) {
+ error = _xfs_log_force_lsn(ip->i_mount,
+ ip->i_itemp->ili_last_lsn,
+ XFS_LOG_SYNC, &log_flushed);
+ } else {
+ error = _xfs_log_force(ip->i_mount,
+ XFS_LOG_SYNC, &log_flushed);
+ }
}
} else {
/*
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH 3/3] xfstests: rename _acl_requirements to _require_acls, Christoph Hellwig |
|---|---|
| Next by Date: | Re: make install in the brave new build system world, Dave Chinner |
| Previous by Thread: | make install in the brave new build system world, Christoph Hellwig |
| Next by Thread: | Re: [PATCH] xfs: optimize log flushing in xfs_fsync, Alex Elder |
| Indexes: | [Date] [Thread] [Top] [All Lists] |