linux/include
Usama Arif 4febfe7d98 block: skip blkcg walk in blk_cgroup_congested() when nothing throttled
blk_cgroup_congested() walks the current task's blkcg ancestor chain on
every readahead decision and, once swap is in use, on every anonymous and
shmem folio allocation.  The answer is almost always "no", but finding that
out costs two loads per level on two cold cache lines, plus an out-of-line
kthread_blkcg() and an RCU read-side pair.  On a fleet profile of hosts
running containers with 5-10 level hierarchies it costs about as much as
all of mutex_lock(), 99.4% of it under __folio_throttle_swaprate().

Gate the walk on a global count of blkcgs with a non-zero
congestion_count.  The counter only moves on the 0 <-> 1 transitions of
each blkcg's congestion_count, so the extra atomic stays in the throttle
arm/disarm paths and never appears in steady state. When something is
throttled the counter is non-zero and the walk runs as before.

Signed-off-by: Usama Arif <usama.arif@linux.dev>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://patch.msgid.link/20260814165712.510132-4-usama.arif@linux.dev
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2026-08-15 17:15:08 -06:00
..
acpi ACPICA: Define acpi_ut_safe_strncpy() as strscpy_pad() alias 2026-07-01 12:29:24 +02:00
asm-generic mm.git review status for mm-hotfixes-stable..mm-nonmm-stable 2026-06-21 13:20:19 -07:00
clocksource
crypto Networking changes for 7.2. 2026-06-17 08:17:00 +01:00
cxl cxl/region: Introduce devm_cxl_probe_mem() 2026-06-12 13:47:30 -07:00
drm drm-misc-fixes for v7.2-rc5: 2026-07-24 18:30:29 +10:00
dt-bindings SoC fixes for 7.2 2026-07-17 08:52:09 -07:00
hyperv
keys keys: Pin request_key_auth payload in instantiate paths 2026-06-15 15:19:13 +03:00
kunit linux_kselftest-kunit-7.2-rc1 2026-06-16 16:33:57 +05:30
kvm Merge branch kvm-arm64/vgic-v5-PPI-fixes into kvmarm-master/next 2026-06-12 09:08:31 +01:00
linux block: skip blkcg walk in blk_cgroup_congested() when nothing throttled 2026-08-15 17:15:08 -06:00
math-emu
media media: v4l2-fwnode: Fix subdev owner overwritten in v4l2_async_register_subdev_sensor() 2026-06-05 10:28:03 +03:00
memory
misc
net tcp: challenge ACK for non-exact RST in SYN-RECEIVED 2026-07-23 08:27:22 -07:00
pcmcia Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (headers) 2026-07-03 07:38:16 +02:00
ras
rdma RDMA v7.2 merge window 2026-06-18 08:16:21 -07:00
rv
scsi scsi: core: wake eh reliably when using scsi_schedule_eh 2026-07-12 22:21:22 -04:00
soc soc/tegra: pmc: Fixes for v7.2 2026-07-10 14:40:52 +02:00
sound Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (headers) 2026-07-03 07:38:16 +02:00
target
trace mm/memory-failure: trace: change memory_failure_event to ras subsystem 2026-07-09 15:48:56 -07:00
uapi block: implement async io_uring zone reset all 2026-08-04 06:55:31 -06:00
ufs Merge branch 7.1/scsi-fixes into 7.2/scsi-staging 2026-06-15 21:01:30 -04:00
vdso
video
xen xen: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files 2026-07-01 09:49:52 +02:00
Kbuild