From: Boris Burkov <boris@bur.io>
To: Roman Mamedov <rm@romanrm.net>
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 1/2] btrfs: set default discard iops_limit to 1000
Date: Wed, 5 Apr 2023 11:46:21 -0700 [thread overview]
Message-ID: <20230405184621.GA1865461@zen> (raw)
In-Reply-To: <20230405223449.1904fcad@nvm>
On Wed, Apr 05, 2023 at 10:34:49PM +0500, Roman Mamedov wrote:
> On Wed, 5 Apr 2023 09:20:32 -0700
> Boris Burkov <boris@bur.io> wrote:
>
> > Previously, the default was a relatively conservative 10. This results
> > in a 100ms delay, so with ~300 discards in a commit, it takes the full
> > 30s till the next commit to finish the discards. On a workstation, this
> > results in the disk never going idle, wasting power/battery, etc.
> >
> > Set the default to 1000, which results in using the smallest possible
> > delay, currently, which is 1ms. This has shown to not pathologically
> > keep the disk busy by the original reporter.
> >
> > Link: https://lore.kernel.org/linux-btrfs/ZCxKc5ZzP3Np71IC@infradead.org/T/#m6ebdeb475809ed7714b21b8143103fb7e5a966da
> > Signed-off-by: Boris Burkov <boris@bur.io>
> > ---
> > fs/btrfs/discard.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/btrfs/discard.c b/fs/btrfs/discard.c
> > index 317aeff6c1da..aef789bcff8f 100644
> > --- a/fs/btrfs/discard.c
> > +++ b/fs/btrfs/discard.c
> > @@ -60,7 +60,7 @@
> > #define BTRFS_DISCARD_TARGET_MSEC (6 * 60 * 60UL * MSEC_PER_SEC)
> > #define BTRFS_DISCARD_MIN_DELAY_MSEC (1UL)
> > #define BTRFS_DISCARD_MAX_DELAY_MSEC (1000UL)
> > -#define BTRFS_DISCARD_MAX_IOPS (10U)
> > +#define BTRFS_DISCARD_MAX_IOPS (10000U)
>
> But the patch sets 10000?
Oops. Thanks!
... Just testing the clamping? I did run the code and observe 100ms
delays between workfn runs, for what it's worth, so it "should be fine"
but I'll resend setting it to 1k properly.
>
> >
> > /* Monotonically decreasing minimum length filters after index 0 */
> > static int discard_minlen[BTRFS_NR_DISCARD_LISTS] = {
>
>
> --
> With respect,
> Roman
next prev parent reply other threads:[~2023-04-05 18:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-05 16:20 [PATCH 0/2] btrfs: adjust async discard tuning Boris Burkov
2023-04-05 16:20 ` [PATCH 1/2] btrfs: set default discard iops_limit to 1000 Boris Burkov
2023-04-05 17:34 ` Roman Mamedov
2023-04-05 18:46 ` Boris Burkov [this message]
2023-04-05 16:20 ` [PATCH 2/2] btrfs: reinterpret async discard iops_limit=0 as no delay Boris Burkov
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=20230405184621.GA1865461@zen \
--to=boris@bur.io \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=rm@romanrm.net \
/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