public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Yangtao Li <frank.li@vivo.com>, jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] f2fs: stop discard thread if has fsck tag
Date: Tue, 1 Nov 2022 23:17:49 +0800	[thread overview]
Message-ID: <fd3f0cc6-1d7c-85bd-9887-ec32dd36601a@kernel.org> (raw)
In-Reply-To: <20221028143733.57322-1-frank.li@vivo.com>

On 2022/10/28 22:37, Yangtao Li wrote:
> Under the current logic, after the fsck flag is set,
> the discard thread will still run periodically.
> 
> So stop the discard thread from running to avoid
> energy consumption after the fsck flag is set.
> 
> Fixes: d618477473eb ("f2fs: stop issue discard if something wrong with f2fs")
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> v2:
> - commit msg changes.
>   fs/f2fs/segment.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 7786351de429..b3600bcadfc7 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1716,8 +1716,8 @@ static int issue_discard_thread(void *data)
>   		if (kthread_should_stop())
>   			return 0;
>   		if (is_sbi_flag_set(sbi, SBI_NEED_FSCK)) {
> -			wait_ms = dpolicy.max_interval;
> -			continue;
> +			dcc->f2fs_issue_discard = NULL;
> +			return 0;

I don't think there will be much energy consumption, I guess
we can keep as it is.

>   		}
>   		if (!atomic_read(&dcc->discard_cmd_cnt))
>   			continue;

      reply	other threads:[~2022-11-01 15:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28 14:37 [PATCH v2] f2fs: stop discard thread if has fsck tag Yangtao Li
2022-11-01 15:17 ` Chao Yu [this message]

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=fd3f0cc6-1d7c-85bd-9887-ec32dd36601a@kernel.org \
    --to=chao@kernel.org \
    --cc=frank.li@vivo.com \
    --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