-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- v6.13.1
- v6.13
- v6.13-rc7
- v6.13-rc6
- v6.13-rc5
- v6.13-rc4
- v6.13-rc3
- v6.13-rc2
- v6.13-rc1
- v6.12.12
- v6.12.11
- v6.12.10
- v6.12.9
- v6.12.8
- v6.12.7
- v6.12.6
- v6.12.5
- v6.12.4
- v6.12.3
- v6.12.2
- v6.12.1
- v6.12
- v6.12-rc7
- v6.12-rc6
- v6.12-rc5
- v6.12-rc4
- v6.12-rc3
- v6.12-rc2
- v6.12-rc1
- v6.11.11
- v6.11.10
- v6.11.9
- v6.11.8
- v6.11.7
- v6.11.6
- v6.11.5
- v6.11.4
- v6.11.3
- v6.11.2
- v6.11.1
- v6.11
- v6.11-rc7
- v6.11-rc6
- v6.11-rc5
- v6.11-rc4
- v6.11-rc3
- v6.11-rc2
- v6.11-rc1
- v6.10.14
- v6.10.13
- v6.10.12
- v6.10.11
- v6.10.10
- v6.10.9
- v6.10.8
- v6.10.7
- v6.10.6
- v6.10.5
- v6.10.4
- v6.10.3
- v6.10.2
- v6.10.1
- v6.10
- v6.10-rc7
- v6.10-rc6
- v6.10-rc5
- v6.10-rc4
- v6.10-rc3
- v6.10-rc2
- v6.10-rc1
- v6.9.12
- v6.9.11
- v6.9.10
- v6.9.9
- v6.9.8
- v6.9.7
- v6.9.6
- v6.9.5
- v6.9.4
- v6.9.3
- v6.9.2
- v6.9.1
- v6.9
- v6.9-rc7
- v6.9-rc6
- v6.9-rc5
- v6.9-rc4
- v6.9-rc3
- v6.9-rc2
- v6.9-rc1
Showing
5 changed files
with
285 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.