]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
jbd2: fix dbench4 performance regression for 'nobarrier' mounts
authorJan Kara <jack@suse.cz>
Sun, 30 Apr 2017 01:07:30 +0000 (21:07 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 30 Apr 2017 01:07:30 +0000 (21:07 -0400)
Commit b685d3d65ac7 "block: treat REQ_FUA and REQ_PREFLUSH as
synchronous" removed REQ_SYNC flag from WRITE_FUA implementation. Since
JBD2 strips REQ_FUA and REQ_FLUSH flags from submitted IO when the
filesystem is mounted with nobarrier mount option, journal superblock
writes ended up being async writes after this patch and that caused
heavy performance regression for dbench4 benchmark with high number of
processes. In my test setup with HP RAID array with non-volatile write
cache and 32 GB ram, dbench4 runs with 8 processes regressed by ~25%.

Fix the problem by making sure journal superblock writes are always
treated as synchronous since they generally block progress of the
journalling machinery and thus the whole filesystem.

Fixes: b685d3d65ac791406e0dfd8779cc9b3707fea5a3
CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/jbd2/journal.c

index 9410ec462ba691a87edefe3d82aef97f6f3e2cf3..f1906fa543218ef4b0991c9422c6de2a2592b7bf 100644 (file)
@@ -1361,7 +1361,7 @@ static int jbd2_write_superblock(journal_t *journal, int write_flags)
        jbd2_superblock_csum_set(journal, sb);
        get_bh(bh);
        bh->b_end_io = end_buffer_write_sync;
-       ret = submit_bh(REQ_OP_WRITE, write_flags, bh);
+       ret = submit_bh(REQ_OP_WRITE, write_flags | REQ_SYNC, bh);
        wait_on_buffer(bh);
        if (buffer_write_io_error(bh)) {
                clear_buffer_write_io_error(bh);