* [Ocfs2-devel] [PATCH] OCFS2: fdatasync should skip unimportant metadata writeout
@ 2009-06-09 7:52 Hisashi Hifumi
2009-06-09 17:36 ` Mark Fasheh
2009-06-09 18:01 ` Joel Becker
0 siblings, 2 replies; 3+ messages in thread
From: Hisashi Hifumi @ 2009-06-09 7:52 UTC (permalink / raw)
To: ocfs2-devel
Hi.
In ocfs2, fdatasync and fsync are identical.
I think fdatasync should skip committing transaction when
inode->i_state is set just I_DIRTY_SYNC and this indicates
only atime or/and mtime updates.
Following patch improves fdatasync throughput.
#sysbench --num-threads=16 --max-requests=300000 --test=fileio
--file-block-size=4K --file-total-size=16G --file-test-mode=rndwr
--file-fsync-mode=fdatasync run
Results:
-2.6.30-rc8
Test execution summary:
total time: 107.1445s
total number of events: 119559
total time taken by event execution: 116.1050
per-request statistics:
min: 0.0000s
avg: 0.0010s
max: 0.1220s
approx. 95 percentile: 0.0016s
Threads fairness:
events (avg/stddev): 7472.4375/303.60
execution time (avg/stddev): 7.2566/0.64
-2.6.30-rc8-patched
Test execution summary:
total time: 86.8529s
total number of events: 300016
total time taken by event execution: 24.3077
per-request statistics:
min: 0.0000s
avg: 0.0001s
max: 0.0336s
approx. 95 percentile: 0.0001s
Threads fairness:
events (avg/stddev): 18751.0000/718.75
execution time (avg/stddev): 1.5192/0.05
Thanks.
Signed-off-by: Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
diff -Nrup linux-2.6.30-rc8.org/fs/ocfs2/file.c linux-2.6.30-rc8.ocfs2/fs/ocfs2/file.c
--- linux-2.6.30-rc8.org/fs/ocfs2/file.c 2009-06-04 16:26:26.000000000 +0900
+++ linux-2.6.30-rc8.ocfs2/fs/ocfs2/file.c 2009-06-09 13:50:42.000000000 +0900
@@ -187,6 +187,9 @@ static int ocfs2_sync_file(struct file *
if (err)
goto bail;
+ if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
+ goto bail;
+
journal = osb->journal->j_journal;
err = jbd2_journal_force_commit(journal);
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Ocfs2-devel] [PATCH] OCFS2: fdatasync should skip unimportant metadata writeout
2009-06-09 7:52 [Ocfs2-devel] [PATCH] OCFS2: fdatasync should skip unimportant metadata writeout Hisashi Hifumi
@ 2009-06-09 17:36 ` Mark Fasheh
2009-06-09 18:01 ` Joel Becker
1 sibling, 0 replies; 3+ messages in thread
From: Mark Fasheh @ 2009-06-09 17:36 UTC (permalink / raw)
To: ocfs2-devel
On Tue, Jun 09, 2009 at 04:47:45PM +0900, Hisashi Hifumi wrote:
> Hi.
>
> In ocfs2, fdatasync and fsync are identical.
> I think fdatasync should skip committing transaction when
> inode->i_state is set just I_DIRTY_SYNC and this indicates
> only atime or/and mtime updates.
> Following patch improves fdatasync throughput.
That looks great, thanks for the patch Hisashi!
> Signed-off-by: Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
Acked-by: Mark Fasheh <mfasheh@suse.com>
--Mark
--
Mark Fasheh
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Ocfs2-devel] [PATCH] OCFS2: fdatasync should skip unimportant metadata writeout
2009-06-09 7:52 [Ocfs2-devel] [PATCH] OCFS2: fdatasync should skip unimportant metadata writeout Hisashi Hifumi
2009-06-09 17:36 ` Mark Fasheh
@ 2009-06-09 18:01 ` Joel Becker
1 sibling, 0 replies; 3+ messages in thread
From: Joel Becker @ 2009-06-09 18:01 UTC (permalink / raw)
To: ocfs2-devel
On Tue, Jun 09, 2009 at 04:47:45PM +0900, Hisashi Hifumi wrote:
> In ocfs2, fdatasync and fsync are identical.
> I think fdatasync should skip committing transaction when
> inode->i_state is set just I_DIRTY_SYNC and this indicates
> only atime or/and mtime updates.
> Following patch improves fdatasync throughput.
Nicely done, thanks. This is now in the ocfs2 git tree.
Joel
--
"Always give your best, never get discouraged, never be petty; always
remember, others may hate you. Those who hate you don't win unless
you hate them. And then you destroy yourself."
- Richard M. Nixon
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-09 18:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-09 7:52 [Ocfs2-devel] [PATCH] OCFS2: fdatasync should skip unimportant metadata writeout Hisashi Hifumi
2009-06-09 17:36 ` Mark Fasheh
2009-06-09 18:01 ` Joel Becker
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.