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>