Thread (59 messages) 59 messages, 14 authors, 2025-05-27

Re: [PATCHSET wq/for-6.9] workqueue: Implement BH workqueue and convert several tasklet users

From: Tejun Heo <tj@kernel.org>
Date: 2024-01-30 09:22:21
Also in: dm-devel, lkml

Oops, forgot to cc Lai.

On Mon, Jan 29, 2024 at 11:11:47PM -1000, Tejun Heo wrote:
Hello,

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.

Mikulas Patocka recently reported that dm-crypt and dm-crypt are affected by
the access-after-completion issue and suggested adding TASKLET_STATE_ONESHOT
flag which selectively removes post-completion access while significantly
limiting how the tasklet can be used in the following thread:

 http://lkml.kernel.org/r/82b964f0-c2c8-a2c6-5b1f-f3145dc2c8e5@redhat.com

Linus didn't like the approach and suggested extending workqueue to support
execution from atomic context:

 http://lkml.kernel.org/r/CAHk-=wjDW53w4-YcSmgKC5RruiRLHmJ1sXeYdp_ZgVoBw=5byA@mail.gmail.com

As suggested, this patchset implements BH workqueues which are like regular
workqueues but executes work items in the BH (softirq) context and converts
several tasklet users.
Lai, the patchset is at:

 http://lkml.kernel.org/r/20240130091300.2968534-1-tj@kernel.org

I'd really appreciate if you can take a look.

Thanks.

-- 
tejun
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help