linux-stable/lib
Yu Kuai 537287e897 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:41:31 +02:00
..
842
crypto This push fixes a regression in ahash (broken fallback finup) 2025-06-19 23:15:10 -07:00
dim
fonts
kunit kunit: Fix wrong parameter to kunit_deactivate_static_stub() 2025-05-21 09:51:23 -06:00
lz4
lzo
math
pldmfw pldmfw: Don't require send_package_data or send_component_table to be defined 2025-05-15 12:59:18 +02:00
raid6 raid6: riscv: Fix NULL pointer dereference caused by a missing clobber 2025-06-12 12:21:48 -07:00
reed_solomon
test_fortify kbuild: require gcc-8 and binutils-2.30 2025-04-30 21:53:35 +02:00
tests kunit/fortify: Add back "volatile" for sizeof() constants 2025-08-15 16:38:22 +02:00
vdso mseal sysmap: generic vdso vvar mapping 2025-04-01 15:17:15 -07:00
xz
zlib_deflate
zlib_dfltcc
zlib_inflate zlib: add module description 2025-04-11 17:32:38 -07:00
zstd Update zstd to the latest upstream release v1.5.7. Imported cleanly from the 2025-03-26 21:35:28 -07:00
.gitignore
alloc_tag.c lib/alloc_tag: do not acquire non-existent lock in alloc_tag_top_users() 2025-07-09 21:07:52 -07:00
argv_split.c
ashldi3.c
ashrdi3.c
asn1_decoder.c ASN.1: add module description 2025-04-11 17:32:37 -07:00
asn1_encoder.c
assoc_array.c
atomic64_test.c
atomic64.c
audit.c
base64.c
bcd.c
bch.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.c
closure.c
clz_ctz.c
clz_tab.c
cmdline.c
cmpdi2.c
cmpxchg-emu.c
codetag.c alloc_tag: handle module codetag load errors as module load failures 2025-06-05 22:02:23 -07:00
compat_audit.c
cpu_rmap.c
cpumask.c
crc4.c
crc7.c
crc8.c
crc16.c lib/crc16: unexport crc16_table and crc16_byte() 2025-05-13 20:37:16 -07:00
crc32.c Networking changes for 6.16. 2025-05-28 15:24:36 -07:00
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 devres: Export devm_ioremap_resource_wc() 2025-05-05 16:18:09 -05:00
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-03-25 06:26:55 -07:00
earlycpio.c
errname.c
error-inject.c
errseq.c errseq: eliminate special limitation for macro MAX_ERRNO 2025-05-11 17:54:06 -07:00
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 find: Add find_first_andnot_bit() 2025-05-15 20:24:40 +02:00
flex_proportions.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-06-25 15:55:03 -07:00
hexdump.c
hweight.c
idr.c ida: Add ida_find_first_range() 2025-03-25 10:18:31 -03:00
inflate.c
interval_tree_test.c
interval_tree.c
iomap_copy.c
iomap.c
iomem_copy.c
iommu-helper.c
iov_iter.c iov_iter: use iov_offset for length calculation in iov_iter_aligned_bvec 2025-06-05 22:02:23 -07:00
irq_poll.c
irq_regs.c
is_single_threaded.c
kasprintf.c
Kconfig pldmfw: Select CRC32 when PLDMFW is selected 2025-06-16 14:12:08 -07:00
Kconfig.debug - The 3 patch series "hung_task: extend blocking task stacktrace dump to 2025-05-31 19:12:53 -07:00
Kconfig.kasan
Kconfig.kcsan
Kconfig.kfence
Kconfig.kgdb
Kconfig.kmsan
Kconfig.ubsan hardening fixes for v6.16-rc1 (take 2) 2025-06-01 11:37:01 -07:00
kfifo.c
klist.c
kobject_uevent.c
kobject.c
kstrtox.c kstrtox: add support for enabled and disabled in kstrtobool() 2025-05-11 17:54:06 -07:00
kstrtox.h
linear_ranges.c
list_debug.c
list_sort.c
llist.c llist: make llist_add_batch() a static inline 2025-05-27 19:40:34 -07:00
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
lru_cache.c
lshrdi3.c
lwq.c
Makefile kbuild: Switch from -Wvla to -Wvla-larger-than=1 2025-05-08 09:42:06 -07:00
maple_tree.c maple_tree: fix mt_destroy_walk() on root leaf node 2025-07-09 21:07:52 -07:00
memcat_p.c
memory-notifier-error-inject.c
memregion.c
memweight.c
min_heap.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 lib/oid_registry.c: remove unused sprint_OID 2025-05-11 17:54:13 -07:00
once.c
packing_test.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 ratelimit: Drop redundant accesses to burst 2025-05-08 16:13:27 -07:00
rbtree_test.c
rbtree.c lib/rbtree.c: fix the example typo 2025-05-11 17:54:04 -07:00
rcuref.c
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:41:31 +02:00
scatterlist.c scatterlist: fix extraneous '@'-sign kernel-doc notation 2025-06-11 22:42:35 -07:00
seq_buf.c
sg_pool.c
sg_split.c lib: scatterlist: fix sg_split_phys to preserve original scatterlist offsets 2025-04-01 15:20:46 -07:00
siphash.c
smp_processor_id.c
sort.c lib/sort.c: add _nonatomic() variants with cond_resched() 2025-04-01 15:20:46 -07:00
stackdepot.c
stmp_device.c
string_helpers.c lib/string_helpers: Introduce parse_int_array() 2025-04-07 15:07:56 +01:00
string.c string: Add load_unaligned_zeropad() code path to sized_strscpy() 2025-04-15 13:50:17 -07:00
strncpy_from_user.c
strnlen_user.c
syscall.c
test_bitmap.c
test_bitops.c
test_bpf.c
test_debug_virtual.c
test_dynamic_debug.c
test_firmware.c
test_fpu_glue.c
test_fpu_impl.c
test_fpu.h
test_free_pages.c
test_hexdump.c
test_hmm_uapi.h
test_hmm.c
test_ida.c ida: Add ida_find_first_range() 2025-03-25 10:18:31 -03:00
test_kmod.c lib/test_kmod: do not hardcode/depend on any filesystem 2025-05-11 17:54:09 -07:00
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-01 17:29:00 -07:00
test_objpool.c
test_parman.c
test_ref_tracker.c
test_rhashtable.c
test_static_key_base.c
test_static_keys.c
test_sysctl.c sysctl: Close test ctl_headers with a for loop 2025-04-14 14:13:41 +02:00
test_ubsan.c ubsan: Fix panic from test_ubsan_out_of_bounds 2025-04-15 13:50:17 -07:00
test_uuid.c
test_vmalloc.c lib/test_vmalloc.c: allow built-in execution 2025-05-11 17:48:34 -07:00
test_xarray.c xarray: make xa_alloc_cyclic() return 0 on all success cases 2025-05-11 17:48:19 -07:00
test-kstrtox.c
textsearch.c
timerqueue.c
trace_readwrite.c
ts_bm.c
ts_fsm.c
ts_kmp.c
ubsan.c KVM: arm64: Introduce CONFIG_UBSAN_KVM_EL2 2025-05-07 11:21:35 +01:00
ubsan.h
ucmpdi2.c
ucs2_string.c ucs2_string: add module description 2025-04-11 17:32:38 -07:00
union_find.c
usercopy.c
uuid.c
vsprintf.c drm for 6.16-rc1 2025-05-28 09:46:39 -07:00
win_minmax.c
xarray.c xarray: fix kerneldoc for __xa_cmpxchg 2025-05-12 23:50:49 -07:00
xxhash.c