diff options
author | Mike Snitzer <snitzer@kernel.org> | 2023-03-27 19:59:25 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2023-03-30 21:57:51 +0200 |
commit | 0bac3f2f28b87b520e50a196c42409485acfe5cf (patch) | |
tree | 9b284a765f4e18da335e78af8be01d87c61de3c3 /drivers/virtio/Kconfig | |
parent | dm bio prison v1: add dm_cell_key_has_valid_range (diff) | |
download | linux-0bac3f2f28b87b520e50a196c42409485acfe5cf.tar.xz linux-0bac3f2f28b87b520e50a196c42409485acfe5cf.zip |
dm: add dm_num_hash_locks()
Simple helper to use when DM core code needs to appropriately size,
based on num_online_cpus(), its data structures that split locks.
dm_num_hash_locks() rounds up num_online_cpus() to next power of 2
but caps return at DM_HASH_LOCKS_MAX (64).
This heuristic may evolve as warranted, but as-is it will serve as a
more informed basis for sizing the sharded lock structs in dm-bufio's
dm_buffer_cache (buffer_trees) and dm-bio-prison-v1's dm_bio_prison
(prison_regions).
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/virtio/Kconfig')
0 files changed, 0 insertions, 0 deletions