From: Sahitya Tummala <stummala@codeaurora.org>
To: Chao Yu <yuchao0@huawei.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix the discard thread sleep timeout under high utilization
Date: Mon, 15 Mar 2021 13:16:45 +0530 [thread overview]
Message-ID: <20210315074645.GA8562@codeaurora.org> (raw)
In-Reply-To: <49be0c70-4fe4-6acd-b508-08621f0623c0@huawei.com>
Hi Chao,
On Mon, Mar 15, 2021 at 02:12:44PM +0800, Chao Yu wrote:
> Sahitya,
>
> On 2021/3/15 12:56, Sahitya Tummala wrote:
> >When f2fs is heavily utilized over 80%, the current discard policy
> >sets the max sleep timeout of discard thread as 50ms
> >(DEF_MIN_DISCARD_ISSUE_TIME). But this is set even when there are
> >no pending discard commands to be issued. This results into
> >unnecessary frequent and periodic wake ups of the discard thread.
> >This patch adds check for pending discard commands in addition
> >to heavy utilization condition to prevent those wake ups.
>
> Could this commit fix your issue?
>
> https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev&id=43f8c47ea7d59c7b2270835f1d7c4618a1ea27b6
>
I don't think it will help because we are changing the max timeout of the
dpolicy itself in __init_discard_policy() when util > 80% as below -
dpolicy->max_interval = DEF_MIN_DISCARD_ISSUE_TIME;
And issue_discard_thread() uses this value as wait_ms, when there
are no more pending discard commands to be issued.
<snip>
} else {
wait_ms = dpolicy.max_interval;
}
<snip>
The new patch posted above is not changing anything related to the max_interval.
Hence, I think it won't help the uncessary wakeup problem I am trying to solve
for this condition - util > 80% and when there are no pending discards.
Please let me know if i am missing something.
Thanks,
Sahitya.
> Thanks,
>
> >
> >Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
> >---
> > fs/f2fs/segment.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> >diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> >index dced46c..df30220 100644
> >--- a/fs/f2fs/segment.c
> >+++ b/fs/f2fs/segment.c
> >@@ -1112,6 +1112,8 @@ static void __init_discard_policy(struct f2fs_sb_info *sbi,
> > struct discard_policy *dpolicy,
> > int discard_type, unsigned int granularity)
> > {
> >+ struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info;
> >+
> > /* common policy */
> > dpolicy->type = discard_type;
> > dpolicy->sync = true;
> >@@ -1129,7 +1131,8 @@ static void __init_discard_policy(struct f2fs_sb_info *sbi,
> > dpolicy->io_aware = true;
> > dpolicy->sync = false;
> > dpolicy->ordered = true;
> >- if (utilization(sbi) > DEF_DISCARD_URGENT_UTIL) {
> >+ if (utilization(sbi) > DEF_DISCARD_URGENT_UTIL &&
> >+ atomic_read(&dcc->discard_cmd_cnt)) {
> > dpolicy->granularity = 1;
> > dpolicy->max_interval = DEF_MIN_DISCARD_ISSUE_TIME;
> > }
> >
--
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2021-03-15 7:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 4:56 [f2fs-dev] [PATCH] f2fs: fix the discard thread sleep timeout under high utilization Sahitya Tummala
2021-03-15 6:12 ` Chao Yu
2021-03-15 7:46 ` Sahitya Tummala [this message]
2021-03-15 8:10 ` Chao Yu
2021-03-15 9:45 ` Sahitya Tummala
2021-03-15 10:31 ` Chao Yu
2021-03-16 9:34 ` Sahitya Tummala
2021-04-06 9:09 ` [f2fs-dev] [PATCH v2] f2fs: fix the periodic wakeups of discard thread Sahitya Tummala
2021-04-06 9:29 ` 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=20210315074645.GA8562@codeaurora.org \
--to=stummala@codeaurora.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=yuchao0@huawei.com \
/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).