]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
f2fs: shrink blk plug region
authorChao Yu <yuchao0@huawei.com>
Mon, 27 Mar 2017 10:14:05 +0000 (18:14 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 12 Apr 2017 19:57:05 +0000 (12:57 -0700)
Don't use blk plug covering area where there won't be any IOs being issued.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c

index 471ea994441218c502b0c65f6e902c89013de90b..58cfbe3d4dc7d6679537c66dde924bf2f9f8df9f 100644 (file)
@@ -853,9 +853,8 @@ repeat:
        if (kthread_should_stop())
                return 0;
 
-       blk_start_plug(&plug);
-
        mutex_lock(&dcc->cmd_lock);
+       blk_start_plug(&plug);
        list_for_each_entry_safe(dc, tmp, pend_list, list) {
                f2fs_bug_on(sbi, dc->state != D_PREP);
 
@@ -865,6 +864,7 @@ repeat:
                if (iter++ > DISCARD_ISSUE_RATE)
                        break;
        }
+       blk_finish_plug(&plug);
 
        list_for_each_entry_safe(dc, tmp, wait_list, list) {
                if (dc->state == D_DONE) {
@@ -874,8 +874,6 @@ repeat:
        }
        mutex_unlock(&dcc->cmd_lock);
 
-       blk_finish_plug(&plug);
-
        iter = 0;
        congestion_wait(BLK_RW_SYNC, HZ/50);