linux/include
Tejun Heo 4fe9852927 rhashtable: Bounce deferred worker kick through irq_work
Inserts past 75% load call schedule_work(&ht->run_work) to kick an
async resize. If a caller holds a raw spinlock (e.g. an
insecure_elasticity user), schedule_work() under that lock records

  caller_lock -> pool->lock -> pi_lock -> rq->__lock

A cycle forms if any of these locks is acquired in the reverse
direction elsewhere. sched_ext, the only current insecure_elasticity
user, hits this: it holds scx_sched_lock across rhashtable inserts of
sub-schedulers, while scx_bypass() takes rq->__lock -> scx_sched_lock.
Exercising the resize path produces:

  Chain exists of:
    &pool->lock --> &rq->__lock --> scx_sched_lock

Bounce the kick from the insert paths through irq_work so
schedule_work() runs from hard IRQ context with the caller's lock no
longer held. rht_deferred_worker()'s self-rearm on error stays on
schedule_work(&ht->run_work) - the worker runs in process context with
no caller lock held, and keeping the self-requeue on @run_work lets
cancel_work_sync() in rhashtable_free_and_destroy() drain it.

v3: Keep rht_deferred_worker()'s self-rearm on schedule_work(&run_work).
    Routing it through irq_work in v2 broke cancel_work_sync()'s
    self-requeue handling - an irq_work queued after irq_work_sync()
    returned but while cancel_work_sync() was still waiting could fire
    post-teardown.

v2: Bounce unconditionally instead of gating on insecure_elasticity,
    as suggested by Herbert.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
2026-04-20 20:10:50 -10:00
..
acpi Power management updates for 7.1-rc1 2026-04-13 19:47:52 -07:00
asm-generic mm.git review status for linus..mm-stable 2026-04-15 12:59:16 -07:00
clocksource
crypto This update includes the following changes: 2026-04-15 15:22:26 -07:00
cxl
drm ttm/pool: port to list_lru. (v2) 2026-04-08 06:52:47 +10:00
dt-bindings pmdomain core: 2026-04-15 14:22:42 -07:00
hyperv mshv: Fix infinite fault loop on permission-denied GPA intercepts 2026-04-04 05:25:53 +00:00
keys
kunit
kvm
linux rhashtable: Bounce deferred worker kick through irq_work 2026-04-20 20:10:50 -10:00
math-emu
media media: subdev: Split v4l2_subdev_get_frame_desc_passthrough() into locked and unlocked 2026-03-24 11:58:02 +01:00
memory
misc
net mm.git review status for linus..mm-stable 2026-04-15 12:59:16 -07:00
pcmcia
ras
rdma
rv rv: Add support for per-object monitors in DA/HA 2026-03-31 16:47:17 +02:00
scsi
soc
sound ASoC: Updates for v7.1 2026-04-13 18:09:48 +02:00
target
trace Runtime Verification updates for 7.1: 2026-04-15 17:15:18 -07:00
uapi VFIO updates for v7.1-rc1 2026-04-16 08:01:16 -07:00
ufs
vdso vdso/datapage: Trim down unnecessary includes 2026-03-11 15:22:39 +01:00
video
xen xen/grant-table: guard gnttab_suspend/resume with CONFIG_HIBERNATE_CALLBACKS 2026-04-10 11:07:21 +02:00
Kbuild