All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Yangtao Li <frank.li@vivo.com>
Subject: Re: [f2fs-dev] [PATCH v2] f2fs: don't call f2fs_issue_discard_timeout() when discard_cmd_cnt is 0 in f2fs_put_super()
Date: Mon, 12 Dec 2022 17:41:51 -0800	[thread overview]
Message-ID: <Y5fYXwWu91cxskFj@google.com> (raw)
In-Reply-To: <a364cb12-3241-50a7-fdd5-323825d0a911@kernel.org>

On 12/13, Chao Yu wrote:
> On 2022/12/13 6:45, Jaegeuk Kim wrote:
> > On 12/12, Chao Yu wrote:
> > > On 2022/12/12 22:14, Yangtao Li wrote:
> > > > Hi Chao,
> > > > 
> > > > > The difference here is, if we use f2fs_realtime_discard_enable() in
> > > > > f2fs_put_super(), we will only write checkpoint w/ CP_TRIMMED flag
> > > > > when discard option is enable and device supports discard.
> > > > 
> > > > > But actually, if discard option is disabled, we still needs to give
> > > > > put_super() a chance to write checkpoint w/ CP_TRIMMED flag.
> > > > 
> > > > Why do we still have to set the CP_TRIMMED flag when the discard opt is not set.
> > > > Did I miss something?
> > > 
> > > Hi Yangtao,
> > > 
> > > I guess it's up to scenario. e.g.
> > > 
> > > mount w/ nodiscard and use FITRIM to trigger in-batch discard,
> > > if we set CP_TRIMMED flag during umount, next time, after mount
> > > w/ discard, it doesn't to issue redundant discard.
> > 
> > If fitrim was called with a range, we can get a wrong FI_TRIMMED flag. Isn't it
> 
> We can set CP_TRIMMED flag only if fitrim was called on full range w/ 4k granularity,
> due to it will check sbi->discard_blks variable to make sure there is no range we
> haven't trimmed.
> 
> > better to get a full discard range after remount even though some are redundant?
> 
> If nodiscard is set, and sbi->discard_blks becomes zero, it says a full range fitrim
> was been triggered.

That gives another assumption, and I prefer to make it simple.

> 
> So, previous check condition has no problem, right?
> 
> 	if ((f2fs_hw_support_discard(sbi) || f2fs_hw_should_discard(sbi)) &&
> 					!sbi->discard_blks && !dropped) {
> 
> Thanks,
> 
> > 
> > > 
> > > Thanks,
> > > 
> > > > 
> > > > Thx,
> > > > Yangtao


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: Yangtao Li <frank.li@vivo.com>,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] f2fs: don't call f2fs_issue_discard_timeout() when discard_cmd_cnt is 0 in f2fs_put_super()
Date: Mon, 12 Dec 2022 17:41:51 -0800	[thread overview]
Message-ID: <Y5fYXwWu91cxskFj@google.com> (raw)
In-Reply-To: <a364cb12-3241-50a7-fdd5-323825d0a911@kernel.org>

On 12/13, Chao Yu wrote:
> On 2022/12/13 6:45, Jaegeuk Kim wrote:
> > On 12/12, Chao Yu wrote:
> > > On 2022/12/12 22:14, Yangtao Li wrote:
> > > > Hi Chao,
> > > > 
> > > > > The difference here is, if we use f2fs_realtime_discard_enable() in
> > > > > f2fs_put_super(), we will only write checkpoint w/ CP_TRIMMED flag
> > > > > when discard option is enable and device supports discard.
> > > > 
> > > > > But actually, if discard option is disabled, we still needs to give
> > > > > put_super() a chance to write checkpoint w/ CP_TRIMMED flag.
> > > > 
> > > > Why do we still have to set the CP_TRIMMED flag when the discard opt is not set.
> > > > Did I miss something?
> > > 
> > > Hi Yangtao,
> > > 
> > > I guess it's up to scenario. e.g.
> > > 
> > > mount w/ nodiscard and use FITRIM to trigger in-batch discard,
> > > if we set CP_TRIMMED flag during umount, next time, after mount
> > > w/ discard, it doesn't to issue redundant discard.
> > 
> > If fitrim was called with a range, we can get a wrong FI_TRIMMED flag. Isn't it
> 
> We can set CP_TRIMMED flag only if fitrim was called on full range w/ 4k granularity,
> due to it will check sbi->discard_blks variable to make sure there is no range we
> haven't trimmed.
> 
> > better to get a full discard range after remount even though some are redundant?
> 
> If nodiscard is set, and sbi->discard_blks becomes zero, it says a full range fitrim
> was been triggered.

That gives another assumption, and I prefer to make it simple.

> 
> So, previous check condition has no problem, right?
> 
> 	if ((f2fs_hw_support_discard(sbi) || f2fs_hw_should_discard(sbi)) &&
> 					!sbi->discard_blks && !dropped) {
> 
> Thanks,
> 
> > 
> > > 
> > > Thanks,
> > > 
> > > > 
> > > > Thx,
> > > > Yangtao

  reply	other threads:[~2022-12-13  1:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02  4:58 [f2fs-dev] [PATCH v2] f2fs: don't call f2fs_issue_discard_timeout() when discard_cmd_cnt is 0 in f2fs_put_super() Yangtao Li via Linux-f2fs-devel
2022-12-02  4:58 ` Yangtao Li
2022-12-11  2:27 ` [f2fs-dev] " Chao Yu
2022-12-11  2:27   ` Chao Yu
2022-12-12 13:05   ` [f2fs-dev] " Yangtao Li via Linux-f2fs-devel
2022-12-12 13:05     ` Yangtao Li
2022-12-12 13:50     ` [f2fs-dev] " Chao Yu
2022-12-12 13:50       ` Chao Yu
2022-12-12 14:14       ` [f2fs-dev] " Yangtao Li via Linux-f2fs-devel
2022-12-12 14:14         ` Yangtao Li
2022-12-12 14:34         ` [f2fs-dev] " Chao Yu
2022-12-12 14:34           ` Chao Yu
2022-12-12 22:45           ` [f2fs-dev] " Jaegeuk Kim
2022-12-12 22:45             ` Jaegeuk Kim
2022-12-13  1:32             ` [f2fs-dev] " Chao Yu
2022-12-13  1:32               ` Chao Yu
2022-12-13  1:41               ` Jaegeuk Kim [this message]
2022-12-13  1:41                 ` Jaegeuk Kim

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=Y5fYXwWu91cxskFj@google.com \
    --to=jaegeuk@kernel.org \
    --cc=chao@kernel.org \
    --cc=frank.li@vivo.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.