[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zbrg3aRFkgS7XCFE@redhat.com>
Date: Wed, 31 Jan 2024 19:07:57 -0500
From: Mike Snitzer <snitzer@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Tejun Heo <tj@...nel.org>, Mikulas Patocka <mpatocka@...hat.com>,
linux-kernel@...r.kernel.org, dm-devel@...ts.linux.dev,
ignat@...udflare.com, damien.lemoal@....com, bob.liu@...cle.com,
houtao1@...wei.com, peterz@...radead.org, mingo@...nel.org,
netdev@...r.kernel.org, allen.lkml@...il.com, kernel-team@...a.com,
Alasdair Kergon <agk@...hat.com>
Subject: Re: [PATCH 8/8] dm-verity: Convert from tasklet to BH workqueue
On Wed, Jan 31 2024 at 6:19P -0500,
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> On Wed, 31 Jan 2024 at 13:32, Tejun Heo <tj@...nel.org> wrote:
> >
> > I don't know, so just did the dumb thing. If the caller always guarantees
> > that the work items are never queued at the same time, reusing is fine.
>
> So the reason I thought it would be a good cleanup to introduce that
> "atomic" workqueue thing (now "bh") was that this case literally has a
> switch between "use tasklets' or "use workqueues".
>
> So it's not even about "reusing" the workqueue, it's literally a
> matter of making it always just use workqueues, and the switch then
> becomes just *which* workqueue to use - system or bh.
DM generally always use dedicated workqueues instead of the system.
The dm-crypt tasklet's completion path did punt to the workqueue
otherwise there was use-after-free of the per-bio-data that included
the tasklet. And for verity there was fallback to workqueue if
tasklet-based verification failed. Didn't inspire confidence.
> In fact, I suspect there is very little reason ever to *not* just use
> the bh one, and even the switch could be removed.
>
> Because I think the only reason the "workqueue of tasklet" choice
> existed in the first place was that workqueues were the "proper" data
> structure, and the tasklet case was added later as a latency hack, and
> everybody knew that tasklets were deprecated.
Correct, abusing tasklets was a very contrived latency optimization.
Happy to see it all go away! (hindsight: it never should have gone in).
Mike
Powered by blists - more mailing lists