btrfs: reinterpret async discard iops_limit=0 as no delay
authorBoris Burkov <boris@bur.io>
Wed, 5 Apr 2023 19:43:59 +0000 (12:43 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Apr 2023 17:52:19 +0000 (19:52 +0200)
commitf263a7c3a53b99f691b41e4925feb67f2e8544d0
tree88f0b0f4be158c2424a36759f8cfc4d7834292e6
parentcfe3445a58658b2a142a9ba5f5de69d91c56a297
btrfs: reinterpret async discard iops_limit=0 as no delay

Currently, a limit of 0 results in a hard coded metering over 6 hours.
Since the default is a set limit, I suspect no one truly depends on this
rather arbitrary setting. Repurpose it for an arguably more useful
"unlimited" mode, where the delay is 0.

Note that if block groups are too new, or go fully empty, there is still
a delay associated with those conditions. Those delays implement
heuristics for not trimming a region we are relatively likely to fully
overwrite soon.

CC: stable@vger.kernel.org # 6.2+
Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Boris Burkov <boris@bur.io>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/discard.c