linux-stable/Documentation
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
..
ABI hwmon updates for v6.8 2024-01-12 13:27:40 -08:00
PCI
RAS Documentation: Begin a RAS section 2023-12-06 21:07:52 +01:00
RCU doc: Mention address and data dependencies in rcu_dereference.rst 2023-12-14 01:16:28 +05:30
accel
accounting
admin-guide RCU pull request for v6.8 2024-01-12 16:35:58 -08:00
arch Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
block
bpf Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
cdrom
core-api workqueue: Implement BH workqueues to eventually replace tasklets 2024-02-04 11:28:06 -10:00
cpu-freq
crypto Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
dev-tools Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
devicetree Devicetree for v6.8: 2024-01-12 15:05:30 -08:00
doc-guide docs: Raise the minimum Sphinx requirement to 2.4.4 2023-12-15 08:36:33 -07:00
driver-api pwm: Changes for v6.8-rc1 2024-01-12 14:59:50 -08:00
fault-injection
fb fbdev/intelfb: Remove driver 2024-01-12 12:38:37 +01:00
features
filesystems dcache stuff for this cycle 2024-01-11 20:11:35 -08:00
firmware-guide
firmware_class
fpga
gpu amd-drm-next-6.8-2024-01-05: 2024-01-09 09:07:50 +10:00
hid
hwmon hwmon: (lm75) Add AMS AS6200 temperature sensor 2024-01-02 08:44:57 -08:00
i2c Documentation/i2c: fix spelling error in i2c-address-translators 2023-12-27 20:05:44 +01:00
iio
images
infiniband
input
isdn
kbuild
kernel-hacking
leds
litmus-tests
livepatch
locking locking/mutex: Clarify that mutex_unlock(), and most other sleeping locks, can still use the lock object after it's unlocked 2024-01-08 09:55:31 +01:00
maintainer Documentation: xfs: consolidate XFS docs into its own subdirectory 2023-12-07 14:49:13 +05:30
mhi
misc-devices
mm mm/rmap: rename COMPOUND_MAPPED to ENTIRELY_MAPPED 2023-12-29 11:58:56 -08:00
netlabel
netlink dpll: expose fractional frequency offset value to user 2024-01-05 07:58:19 -08:00
networking Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
nvdimm
nvme
pcmcia
peci
power Documentation: PM: Adjust freezing-of-tasks.rst to the freezer changes 2023-12-19 21:14:32 +01:00
process Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
rust docs: rust: Clarify that 'rustup override' applies to build directory 2023-12-21 22:47:40 +01:00
scheduler sched/fair: Remove SCHED_FEAT(UTIL_EST_FASTUP, true) 2023-12-23 15:59:56 +01:00
scsi
security Documentation: Destage TEE subsystem documentation 2023-12-08 15:45:10 -07:00
sound
sphinx Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
sphinx-static docs: translations: add translations links when they exist 2023-12-19 14:34:59 -07:00
spi spi: pxa2xx: Update DMA mapping and using logic in the documentation 2023-12-08 17:50:00 +00:00
staging Documentation: Destage TEE subsystem documentation 2023-12-08 15:45:10 -07:00
target
tee Documentation: Destage TEE subsystem documentation 2023-12-08 15:45:10 -07:00
timers
tools
trace Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
translations Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
usb
userspace-api fbdev fixes and cleanups for 6.8-rc1: 2024-01-12 14:38:08 -08:00
virt
w1
watchdog
wmi
.gitignore
Changes
CodingStyle
Kconfig
Makefile doc/netlink: Regenerate netlink .rst files if ynl-gen-rst changes 2023-12-18 14:39:44 -08:00
SubmittingPatches
atomic_bitops.txt
atomic_t.txt
conf.py docs: translations: add translations links when they exist 2023-12-19 14:34:59 -07:00
docutils.conf
dontdiff
index.rst Documentation: Begin a RAS section 2023-12-06 21:07:52 +01:00
memory-barriers.txt doc: Clarify historical disclaimers in memory-barriers.txt 2023-12-14 01:16:28 +05:30
subsystem-apis.rst Documentation: Destage TEE subsystem documentation 2023-12-08 15:45:10 -07:00