mbox series

[v2,0/2] btrfs: adjust async discard tuning

Message ID cover.1680723651.git.boris@bur.io (mailing list archive)
Headers show
Series btrfs: adjust async discard tuning | expand

Message

Boris Burkov April 5, 2023, 7:43 p.m. UTC
Since discard=async became the implicit default in btrfs in the
6.2 kernel, there have been numerous complaints about discard being
too spread out on workstation systems. This results in situations like
a users drive not being idle for an unexpectedly long period of time.

This is caused by a relatively low default iops limit of 10, so this
series raises the default limit to 1000 (1ms delay) and modifies a
weird fallback behavior for limit=0 to be interpreted as unlimited.

Link: https://lore.kernel.org/linux-btrfs/ZCxKc5ZzP3Np71IC@infradead.org/T/#m6ebdeb475809ed7714b21b8143103fb7e5a966da
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2182228
Link: https://www.reddit.com/r/archlinux/comments/121htxn/btrfs_discard_storm_on_62x_kernel/

---
Changelog:
v2: actually set the limit to 1k, not 10k.

Boris Burkov (2):
  btrfs: set default discard iops_limit to 1000
  btrfs: reinterpret async discard iops_limit=0 as no delay

 fs/btrfs/discard.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

Comments

David Sterba April 6, 2023, 2:57 p.m. UTC | #1
On Wed, Apr 05, 2023 at 12:43:57PM -0700, Boris Burkov wrote:
> Since discard=async became the implicit default in btrfs in the
> 6.2 kernel, there have been numerous complaints about discard being
> too spread out on workstation systems. This results in situations like
> a users drive not being idle for an unexpectedly long period of time.
> 
> This is caused by a relatively low default iops limit of 10, so this
> series raises the default limit to 1000 (1ms delay) and modifies a
> weird fallback behavior for limit=0 to be interpreted as unlimited.
> 
> Link: https://lore.kernel.org/linux-btrfs/ZCxKc5ZzP3Np71IC@infradead.org/T/#m6ebdeb475809ed7714b21b8143103fb7e5a966da
> Link: https://bugzilla.redhat.com/show_bug.cgi?id=2182228
> Link: https://www.reddit.com/r/archlinux/comments/121htxn/btrfs_discard_storm_on_62x_kernel/
> 
> ---
> Changelog:
> v2: actually set the limit to 1k, not 10k.
> 
> Boris Burkov (2):
>   btrfs: set default discard iops_limit to 1000
>   btrfs: reinterpret async discard iops_limit=0 as no delay

Added to misc-next, thanks.