diff options
author | Dennis Zhou <dennis@kernel.org> | 2020-01-02 16:26:36 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-01-20 16:40:59 +0100 |
commit | e93591bb6ecf3e31c8f5366eac143f4f9c270915 (patch) | |
tree | dd3e9c2036d245f32a79924f0bb496d3765beef9 /fs/btrfs/ctree.h | |
parent | a2309300841207de28307ecd2f0e031fccde37a3 (diff) | |
download | lwn-e93591bb6ecf3e31c8f5366eac143f4f9c270915.tar.gz lwn-e93591bb6ecf3e31c8f5366eac143f4f9c270915.zip |
btrfs: add kbps discard rate limit for async discard
Provide the ability to rate limit based on kbps in addition to iops as
additional guides for the target discard rate. The delay used ends up
being max(kbps_delay, iops_delay).
Signed-off-by: Dennis Zhou <dennis@kernel.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 451dade0a4bb..f58b1cfeeca6 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -466,10 +466,12 @@ struct btrfs_discard_ctl { spinlock_t lock; struct btrfs_block_group *block_group; struct list_head discard_list[BTRFS_NR_DISCARD_LISTS]; + u64 prev_discard; atomic_t discardable_extents; atomic64_t discardable_bytes; unsigned long delay; u32 iops_limit; + u32 kbps_limit; }; /* delayed seq elem */ |