]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ocfs2: fix a performance issue with synced buffer io
authorRyan Ding <ryan.ding@oracle.com>
Tue, 20 Oct 2015 08:47:33 +0000 (16:47 +0800)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Fri, 30 Oct 2015 16:12:11 +0000 (09:12 -0700)
commit2ba9b9cf9749867d4512934efe3c0e9d2a7e693f
treeece6ed6780fd1c599ef5981962b6a94fb72c2720
parent1153dbea7e4d7f3f83a2b9d62d62bef918eb940b
ocfs2: fix a performance issue with synced buffer io

orabug: 20396205

If we flush data with WB_SYNC_ALL which is set in struct writeback_control. It
will be transfered to a bio with WRITE_SYNC flag(that is done in the interface
block_write_full_page()). And after multi-queue is introduced to kernel block
layer, a bio with SYNC flag will be sent to disk without queue. It will affect
the performance significantly if the disk has a poor iops.

This patch is a work around to this. Use filemap_flush() to try to flush dirty
pages with WB_SYNC_NONE flag.
* In journal=order mode, this is safe because the following
  jbd2_journal_force_commit() will ensure data integrity.
* In journal=writeback mode, we will call filemap_write_and_wait_range() to
  meet the semantics of O_SYNC & O_DIRECT.

It should help to improve performance with direct io (in the case when direct
io fall to buffer io), and buffer io with O_SYNC.

Signed-off-by: Ryan Ding <ryan.ding@oracle.com>
Reviewed-by: Junxiao Bi <junxiao.bi@oracle.com>
fs/ocfs2/file.c