All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: waxhead <waxhead@dirtcellar.net>
Cc: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: scrub: per-device bandwidth control
Date: Tue, 18 May 2021 23:06:17 +0200	[thread overview]
Message-ID: <20210518210617.GU7604@twin.jikos.cz> (raw)
In-Reply-To: <45403ea9-221c-c7eb-faa8-50c9da8e38e9@dirtcellar.net>

On Tue, May 18, 2021 at 10:15:57PM +0200, waxhead wrote:
> Being just the average user I ponder if this feature is an absolute 
> hard-limit or not? E.g. would this limit be applied all the time even if 
> the filesystem is idle? or is it dynamic in the sense that scrub can run 
> a full speed if the filesystem is (reasonably) idle.

The limit is absolute so even if the device is idle, scrub won't go
faster.  Determining the "is it idle" is the hard part and would require
information that the io scheduler has. With that interpret the numbers
(eg. in-flight requests and overall size) and hope that it would match
the actual device performance to make the guesses.

I vaguely remember trying something like that but it became too similar
to a full blown io scheduler, so that's not the right way. There used to
be some kind of block device congestion query but this got removed.

> If this is or could somehow be dynamic would it be possible to set the 
> value to something like for example 30M:15M which may be interpreted as 
> 30MiB/s when not idle and 15MiB/s when not idle.
> 
> I myself would actually much prefer if it was possible to set a reserved 
> bandwidth for all non-scrub related stuff. for example maybe up to max 
> 75% of the bandwidth always reserved for non-scrub related read/writes.
> This would allow the scrub to run at full speed if no other I/O is is 
> taking place in which case the scrub would be limited to 25%.

This looks similar to the md-raid minimum speed setting, for scrub I
picked only the maximum, but there's /proc/sys/dev/raid/speed_limit_min
that in the example would be 15MiB/s (and _max 30MiB/s). This could be
implemented once there's a way to know the idle status. Maybe something
will emerge over time, right now I don't know how to do it.

  reply	other threads:[~2021-05-18 21:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 14:49 [PATCH] btrfs: scrub: per-device bandwidth control David Sterba
2021-05-18 16:52 ` Holger Hoffstätte
2021-05-18 20:46   ` David Sterba
2021-05-18 20:15 ` waxhead
2021-05-18 21:06   ` David Sterba [this message]
2021-05-19  6:53 ` Johannes Thumshirn
2021-05-19 14:26   ` David Sterba
2021-05-19 15:32     ` Johannes Thumshirn
2021-05-19 16:20       ` Graham Cobb
2021-05-20 12:41         ` David Sterba
2021-05-21  7:18         ` Zygo Blaxell
2021-05-21  9:55           ` Graham Cobb
2021-05-20 12:28       ` David Sterba
2021-05-20  7:43 ` Geert Uytterhoeven
2021-05-20 12:55   ` David Sterba
2021-05-20 13:04     ` Geert Uytterhoeven
2021-05-20 13:14   ` Arnd Bergmann
2021-05-20 13:26     ` Geert Uytterhoeven
2021-05-21 15:16     ` David Sterba
2021-05-21 15:38       ` Geert Uytterhoeven

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=20210518210617.GU7604@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=waxhead@dirtcellar.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 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.