linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: dsterba@suse.cz, Chris Mason <clm@fb.com>,
	Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 0/4] fixes for btrfs async discards
Date: Fri, 6 Nov 2020 13:20:25 +0000	[thread overview]
Message-ID: <215f6406-fbe2-9eb6-2ac2-7f28b2666789@gmail.com> (raw)
In-Reply-To: <20201105222305.GN6756@twin.jikos.cz>

On 05/11/2020 22:23, David Sterba wrote:
> On Wed, Nov 04, 2020 at 09:45:50AM +0000, Pavel Begunkov wrote:
>> Several fixes for async discards. The first patch might increase discard
>> rate, drastically in some cases. That may be a suprise for those
>> assuming that hitting iops_limit is rare and rarther outliers. Though,
>> it still stays in allowed range, so should be fine.
> 
> I think this highly depends on the workload, if you really need to issue
> the discards fast because of the rate of the change in the regular data.
> That was the point of the async discard and the knobs, the defaults
> should be ok for most users and allow adjusting for specific loads.

Chris mentioned that _there are_ problems with faster drives though.
The problem is that this iops_limit knot just clamps the chosen delay.
Ultimately, I want to find later a better delay function than

delay = CONSTANT_INTERVAL_MS / nr_extents.

But that will take some thinking.

For instance, one of the cases I've seen is recycling large extents
like deletion of subvolumes. There we have a small number of extents
but each takes a lot of space, so there are, say, 100+GB queued to be
discarded. But because there are few extents, delay is calculated
to >10s that's then clamped to a constant max limit.
That was taking a long to recycle. Not sure though how many bytes/extents
are discarded on each iteration of btrfs_discard_workfn().

> 
> My testing of the original discard patchset was tailored towards the
> default usecase and likely intense than yours. I did not observe the
> corner cases where the work queue scheduling was off, or changing the
> sysfs values did not poke the right kthreads.
> 
> Patches look ok to me and I've added them to topic branch for testing,
> going to misc-next later. Thanks.
> 

-- 
Pavel Begunkov

  reply	other threads:[~2020-11-06 13:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-04  9:45 [PATCH 0/4] fixes for btrfs async discards Pavel Begunkov
2020-11-04  9:45 ` [PATCH 1/4] btrfs: discard: speed up discard up to iops_limit Pavel Begunkov
2020-11-04 15:29   ` Amy Parker
2020-11-04 17:19     ` Pavel Begunkov
2020-11-04 17:33       ` Amy Parker
2020-11-04 17:47         ` Pavel Begunkov
2020-11-04 17:55           ` Amy Parker
2020-11-04 18:06             ` Pavel Begunkov
2020-11-04 18:14               ` Amy Parker
2020-11-04 20:52   ` Josef Bacik
2020-11-04  9:45 ` [PATCH 2/4] btrfs: discard: save discard delay as ns not jiffy Pavel Begunkov
2020-11-04 15:35   ` Amy Parker
2020-11-04 15:48     ` Pavel Begunkov
2020-11-04 16:46       ` Amy Parker
2020-11-04 20:54   ` Josef Bacik
2020-11-04  9:45 ` [PATCH 3/4] btrfs: don't miss discards after override-schedule Pavel Begunkov
2020-11-04 20:59   ` Josef Bacik
2020-11-04 21:23     ` Pavel Begunkov
2020-11-04  9:45 ` [PATCH 4/4] btrfs: discard: reschedule work after param update Pavel Begunkov
2020-11-04 21:00   ` Josef Bacik
2020-11-05 22:23 ` [PATCH 0/4] fixes for btrfs async discards David Sterba
2020-11-06 13:20   ` Pavel Begunkov [this message]
2020-11-06 13:56     ` David Sterba
2020-11-06 14:19     ` Chris Mason

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=215f6406-fbe2-9eb6-2ac2-7f28b2666789@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@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).