linux-stable/lib
Yu Kuai ed30c38d1e lib/sbitmap: convert shallow_depth from one word to the whole sbitmap
[ Upstream commit 42e6c6ce03 ]

Currently elevators will record internal 'async_depth' to throttle
asynchronous requests, and they both calculate shallow_dpeth based on
sb->shift, with the respect that sb->shift is the available tags in one
word.

However, sb->shift is not the availbale tags in the last word, see
__map_depth:

if (index == sb->map_nr - 1)
  return sb->depth - (index << sb->shift);

For consequence, if the last word is used, more tags can be get than
expected, for example, assume nr_requests=256 and there are four words,
in the worst case if user set nr_requests=32, then the first word is
the last word, and still use bits per word, which is 64, to calculate
async_depth is wrong.

One the ohter hand, due to cgroup qos, bfq can allow only one request
to be allocated, and set shallow_dpeth=1 will still allow the number
of words request to be allocated.

Fix this problems by using shallow_depth to the whole sbitmap instead
of per word, also change kyber, mq-deadline and bfq to follow this,
a new helper __map_depth_with_shallow() is introduced to calculate
available bits in each word.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20250807032413.1469456-2-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-20 18:30:49 +02:00
..
842 lib: 842: Improve error handling in sw842_compress() 2025-04-10 14:39:19 +02:00
crypto crypto: lib/Kconfig - Hide arch options from user 2025-05-02 07:59:32 +02:00
dim
fonts
kunit kunit: Fix wrong parameter to kunit_deactivate_static_stub() 2025-06-19 15:31:30 +02:00
lz4
lzo crypto: lzo - Fix compression buffer overrun 2025-05-29 11:02:25 +02:00
math
pldmfw
raid6
reed_solomon
test_fortify
vdso
xz
zlib_deflate
zlib_dfltcc
zlib_inflate
zstd zstd: Increase DYNAMIC_BMI2 GCC version cutoff from 4.8 to 11.0 to work around compiler segfault 2025-04-20 10:15:12 +02:00
.gitignore
alloc_tag.c lib/alloc_tag: do not acquire non-existent lock in alloc_tag_top_users() 2025-07-17 18:37:14 +02:00
argv_split.c
ashldi3.c
ashrdi3.c
asn1_decoder.c
asn1_encoder.c
assoc_array.c
atomic64_test.c
atomic64.c
audit.c
base64.c
bcd.c
bch.c
bitfield_kunit.c
bitmap-str.c
bitmap.c
bitrev.c
bootconfig-data.S
bootconfig.c
bsearch.c
btree.c
bucket_locks.c
bug.c
build_OID_registry
buildid.c
bust_spinlocks.c
check_signature.c
checksum_kunit.c
checksum.c
closure.c
clz_ctz.c
clz_tab.c
cmdline_kunit.c
cmdline.c
cmpdi2.c
cmpxchg-emu.c
codetag.c
compat_audit.c
cpu_rmap.c
cpumask_kunit.c
cpumask.c
crc4.c
crc7.c
crc8.c
crc16.c
crc32.c
crc32defs.h
crc32test.c
crc64-rocksoft.c
crc64.c
crc-ccitt.c
crc-itu-t.c
crc-t10dif.c
ctype.c
debug_info.c
debug_locks.c
debugobjects.c
dec_and_lock.c
decompress_bunzip2.c
decompress_inflate.c
decompress_unlz4.c
decompress_unlzma.c
decompress_unlzo.c
decompress_unxz.c
decompress_unzstd.c
decompress.c
devmem_is_allowed.c
devres.c
dhry_1.c
dhry_2.c
dhry_run.c
dhry.h
digsig.c
dump_stack.c
dynamic_debug.c
dynamic_queue_limits.c dql: Fix dql->limit value when reset. 2025-05-29 11:02:07 +02:00
earlycpio.c
errname.c
error-inject.c
errseq.c
extable.c
fault-inject-usercopy.c
fault-inject.c
fdt_addresses.c
fdt_empty_tree.c
fdt_ro.c
fdt_rw.c
fdt_strerror.c
fdt_sw.c
fdt_wip.c
fdt.c
find_bit_benchmark.c
find_bit.c
flex_proportions.c
fortify_kunit.c
fw_table.c
gen_crc32table.c
gen_crc64table.c
genalloc.c
generic-radix-tree.c
glob.c
globtest.c
group_cpus.c lib/group_cpus: fix NULL pointer dereference from group_cpus_evenly() 2025-07-06 11:01:39 +02:00
hashtable_test.c
hexdump.c
hweight.c
idr.c
inflate.c
interval_tree_test.c
interval_tree.c
iomap_copy.c
iomap.c
iommu-helper.c
iov_iter.c iov_iter: use iov_offset for length calculation in iov_iter_aligned_bvec 2025-06-19 15:32:21 +02:00
irq_poll.c
irq_regs.c
is_signed_type_kunit.c
is_single_threaded.c
kasprintf.c
Kconfig pldmfw: Select CRC32 when PLDMFW is selected 2025-06-27 11:11:42 +01:00
Kconfig.debug Kunit to check the longest symbol length 2025-06-27 11:11:41 +01:00
Kconfig.kasan
Kconfig.kcsan
Kconfig.kfence
Kconfig.kgdb
Kconfig.kmsan
Kconfig.ubsan ubsan: integer-overflow: depend on BROKEN to keep this out of CI 2025-07-10 16:05:01 +02:00
kfifo.c
klist.c
kobject_uevent.c
kobject.c
kstrtox.c
kstrtox.h
kunit_iov_iter.c
libcrc32c.c
linear_ranges.c
list_debug.c
list_sort.c
list-test.c
llist.c
locking-selftest-hardirq.h
locking-selftest-mutex.h
locking-selftest-rlock-hardirq.h
locking-selftest-rlock-softirq.h
locking-selftest-rlock.h
locking-selftest-rsem.h
locking-selftest-rtmutex.h
locking-selftest-softirq.h
locking-selftest-spin-hardirq.h
locking-selftest-spin-softirq.h
locking-selftest-spin.h
locking-selftest-wlock-hardirq.h
locking-selftest-wlock-softirq.h
locking-selftest-wlock.h
locking-selftest-wsem.h
locking-selftest.c
lockref.c
logic_iomem.c
logic_pio.c
longest_symbol_kunit.c Kunit to check the longest symbol length 2025-06-27 11:11:41 +01:00
lru_cache.c
lshrdi3.c
lwq.c
Makefile Kunit to check the longest symbol length 2025-06-27 11:11:41 +01:00
maple_tree.c maple_tree: fix mt_destroy_walk() on root leaf node 2025-07-17 18:37:13 +02:00
memcat_p.c
memcpy_kunit.c
memory-notifier-error-inject.c
memregion.c
memweight.c
muldi3.c
net_utils.c
netdev-notifier-error-inject.c
nlattr.c
nmi_backtrace.c
notifier-error-inject.c
notifier-error-inject.h
objagg.c
objpool.c
of-reconfig-notifier-error-inject.c
oid_registry.c
once.c
overflow_kunit.c
packing.c
parman.c
parser.c
percpu_counter.c
percpu_test.c
percpu-refcount.c
plist.c
pm-notifier-error-inject.c
polynomial.c
radix-tree.c
radix-tree.h
random32.c
ratelimit.c
rbtree_test.c
rbtree.c
rcuref.c rcuref: Plug slowpath race in rcuref_put() 2025-03-07 18:25:43 +01:00
ref_tracker.c
refcount.c
rhashtable.c
sbitmap.c lib/sbitmap: convert shallow_depth from one word to the whole sbitmap 2025-08-20 18:30:49 +02:00
scatterlist.c
seq_buf.c
sg_pool.c
sg_split.c lib: scatterlist: fix sg_split_phys to preserve original scatterlist offsets 2025-04-20 10:15:45 +02:00
siphash_kunit.c
siphash.c
slub_kunit.c
smp_processor_id.c
sort.c
stackdepot.c
stackinit_kunit.c kunit/stackinit: Use fill byte different from Clang i386 pattern 2025-04-10 14:39:11 +02:00
stmp_device.c
string_helpers_kunit.c
string_helpers.c
string_kunit.c
string.c string: Add load_unaligned_zeropad() code path to sized_strscpy() 2025-04-25 10:47:55 +02:00
strncpy_from_user.c
strnlen_user.c
syscall.c
test_bitmap.c
test_bitops.c
test_bits.c
test_blackhole_dev.c
test_bpf.c
test_debug_virtual.c
test_dynamic_debug.c
test_firmware.c
test_fprobe.c
test_fpu_glue.c
test_fpu_impl.c
test_fpu.h
test_free_pages.c
test_hash.c
test_hexdump.c
test_hmm_uapi.h
test_hmm.c
test_ida.c
test_kmod.c
test_kprobes.c
test_linear_ranges.c
test_list_sort.c
test_lockup.c
test_maple_tree.c
test_memcat_p.c
test_meminit.c
test_min_heap.c
test_module.c
test_objagg.c lib: test_objagg: Set error message in check_expect_hints_stats() 2025-07-10 16:04:52 +02:00
test_objpool.c
test_parman.c
test_printf.c
test_ref_tracker.c
test_rhashtable.c
test_scanf.c
test_sort.c
test_static_key_base.c
test_static_keys.c
test_sysctl.c
test_ubsan.c ubsan: Fix panic from test_ubsan_out_of_bounds 2025-05-02 07:59:27 +02:00
test_uuid.c
test_vmalloc.c
test_xarray.c
test-kstrtox.c
textsearch.c
timerqueue.c
trace_readwrite.c
ts_bm.c
ts_fsm.c
ts_kmp.c
ubsan.c
ubsan.h
ucmpdi2.c
ucs2_string.c
union_find.c
usercopy_kunit.c kunit/usercopy: Disable u64 test on 32-bit SPARC 2025-06-19 15:31:36 +02:00
usercopy.c
uuid.c
vsprintf.c rust: fix signature of rust_fmt_argument 2025-04-10 14:39:20 +02:00
win_minmax.c
xarray.c
xxhash.c