mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: <jaegeuk@kernel.org>
Cc: <linux-f2fs-devel@lists.sourceforge.net>,
	<linux-kernel@vger.kernel.org>, <chao@kernel.org>,
	Chao Yu <yuchao0@huawei.com>
Subject: [PATCH 2/3] f2fs: shrink blk plug region
Date: Mon, 27 Mar 2017 18:14:05 +0800	[thread overview]
Message-ID: <20170327101406.56028-2-yuchao0@huawei.com> (raw)
In-Reply-To: <20170327101406.56028-1-yuchao0@huawei.com>

Don't use blk plug covering area where there won't be any IOs being issued.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
 fs/f2fs/segment.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index c1a03b0857f9..57a81f9c8c14 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -848,9 +848,8 @@ static int issue_discard_thread(void *data)
 	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);
 
@@ -860,6 +859,7 @@ static int issue_discard_thread(void *data)
 		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)
@@ -867,8 +867,6 @@ static int issue_discard_thread(void *data)
 	}
 	mutex_unlock(&dcc->cmd_lock);
 
-	blk_finish_plug(&plug);
-
 	iter = 0;
 	congestion_wait(BLK_RW_SYNC, HZ/50);
 
-- 
2.8.2.295.g3f1c1d0

  reply	other threads:[~2017-03-27 10:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27 10:14 [PATCH 1/3] f2fs: clean up destroy_discard_cmd_control Chao Yu
2017-03-27 10:14 ` Chao Yu [this message]
2017-04-12  8:33   ` [PATCH 2/3] f2fs: shrink blk plug region Chao Yu
2017-04-12 19:57     ` Jaegeuk Kim
2017-03-27 10:14 ` [PATCH 3/3] f2fs: prevent waiter encountering incorrect discard states Chao Yu
2017-03-27 23:56   ` Jaegeuk Kim
2017-03-28  1:17     ` Chao Yu
2017-04-01  6:54       ` Chao Yu
2017-04-03 17:40         ` Jaegeuk Kim
2017-04-05 10:25           ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170327101406.56028-2-yuchao0@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®