linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 3/3] f2fs: flush stale issued discard candidates
Date: Thu, 13 Dec 2018 21:01:27 -0800	[thread overview]
Message-ID: <20181214050127.45025-3-jaegeuk@kernel.org> (raw)
In-Reply-To: <20181214050127.45025-1-jaegeuk@kernel.org>

Sometimes, I could observe # of issuing_discard to be 1 which blocks background
jobs due to is_idle()=false.
The only way to get out of it was to trigger gc_urgent. This patch avoids that
by checking any candidates as done in the list.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/segment.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 49ea9009ab5a..acbbc924e518 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1651,6 +1651,10 @@ static int issue_discard_thread(void *data)
 		if (dcc->discard_wake)
 			dcc->discard_wake = 0;
 
+		/* clean up pending candidates before going to sleep */
+		if (atomic_read(&dcc->queued_discard))
+			__wait_all_discard_cmd(sbi, NULL);
+
 		if (try_to_freeze())
 			continue;
 		if (f2fs_readonly(sbi->sb))
-- 
2.19.0.605.g01d371f741-goog

  parent reply	other threads:[~2018-12-14  5:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14  5:01 [PATCH 1/3] f2fs: use kvmalloc, if kmalloc is failed Jaegeuk Kim
2018-12-14  5:01 ` [PATCH 2/3] f2fs: correct wrong spelling, issing_* Jaegeuk Kim
2018-12-18  8:39   ` [f2fs-dev] " Chao Yu
2018-12-14  5:01 ` Jaegeuk Kim [this message]
2018-12-18  8:49   ` [f2fs-dev] [PATCH 3/3] f2fs: flush stale issued discard candidates Chao Yu
2018-12-18 22:43     ` Jaegeuk Kim
2018-12-19  3:21       ` Chao Yu
2018-12-18  8:37 ` [f2fs-dev] [PATCH 1/3] f2fs: use kvmalloc, if kmalloc is failed 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=20181214050127.45025-3-jaegeuk@kernel.org \
    --to=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;
as well as URLs for NNTP newsgroup(s).