linux-stable/tools
Tejun Heo 4cb1ef6460 workqueue: Implement BH workqueues to eventually replace tasklets
The only generic interface to execute asynchronously in the BH context is
tasklet; however, it's marked deprecated and has some design flaws such as
the execution code accessing the tasklet item after the execution is
complete which can lead to subtle use-after-free in certain usage scenarios
and less-developed flush and cancel mechanisms.

This patch implements BH workqueues which share the same semantics and
features of regular workqueues but execute their work items in the softirq
context. As there is always only one BH execution context per CPU, none of
the concurrency management mechanisms applies and a BH workqueue can be
thought of as a convenience wrapper around softirq.

Except for the inability to sleep while executing and lack of max_active
adjustments, BH workqueues and work items should behave the same as regular
workqueues and work items.

Currently, the execution is hooked to tasklet[_hi]. However, the goal is to
convert all tasklet users over to BH workqueues. Once the conversion is
complete, tasklet can be removed and BH workqueues can directly take over
the tasklet softirqs.

system_bh[_highpri]_wq are added. As queue-wide flushing doesn't exist in
tasklet, all existing tasklet users should be able to use the system BH
workqueues without creating their own workqueues.

v3: - Add missing interrupt.h include.

v2: - Instead of using tasklets, hook directly into its softirq action
      functions - tasklet[_hi]_action(). This is slightly cheaper and closer
      to the eventual code structure we want to arrive at. Suggested by Lai.

    - Lai also pointed out several places which need NULL worker->task
      handling or can use clarification. Updated.

Signed-off-by: Tejun Heo <tj@kernel.org>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/CAHk-=wjDW53w4-YcSmgKC5RruiRLHmJ1sXeYdp_ZgVoBw=5byA@mail.gmail.com
Tested-by: Allen Pais <allen.lkml@gmail.com>
Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com>
2024-02-04 11:28:06 -10:00
..
accounting
arch - Add synthetic X86_FEATURE flags for the different AMD Zen generations 2024-01-08 15:45:31 -08:00
bootconfig
bpf bpfilter: remove bpfilter 2024-01-04 10:23:10 -08:00
build perf tools fixes for v6.6: 2nd batch 2023-10-30 13:46:27 -07:00
certs
cgroup samples: introduce new samples subdir for cgroup 2023-12-10 16:51:54 -08:00
counter
crypto crypto: tcrypt - add script tcrypt_speed_compare.py 2023-12-29 11:25:55 +08:00
debugging
edid
firewire
firmware
gpio
hv hv/hv_kvp_daemon: Some small fixes for handling NM keyfiles 2023-11-10 23:27:46 +00:00
iio
include sound updates for 6.8-rc1 2024-01-12 11:55:28 -08:00
kvm/kvm_stat
laptop
leds
lib libbpf: implement __arg_ctx fallback logic 2024-01-03 21:22:49 -08:00
memory-model
mm
net/ynl tools/net/ynl-gen-rst: Remove extra indentation from generated docs 2023-12-18 14:39:44 -08:00
objtool Address a GCC-14 warning: there's no real bug, but indeed the calloc order doesn't match 2024-01-08 18:31:27 -08:00
pci
pcmcia
perf lsm/stable-6.8 PR 20240105 2024-01-09 12:57:46 -08:00
power PM: tools: Fix sleepgraph syntax error 2023-11-20 17:59:58 +01:00
rcu
scripts
spi
testing RCU pull request for v6.8 2024-01-12 16:35:58 -08:00
thermal tools/thermal/tmon: Fix compilation warning for wrong format 2024-01-02 09:33:19 +01:00
time
tracing rtla: Fix uninitialized variable found 2023-10-30 19:00:12 +01:00
usb
verification verification/dot2k: Delete duplicate imports 2023-10-30 16:59:12 +01:00
virtio
wmi
workqueue workqueue: Implement BH workqueues to eventually replace tasklets 2024-02-04 11:28:06 -10:00
Makefile