Re: [PATCH 0/3] workqueue: Make the workqueue code PREEMPT_RT safe

From: Linus Torvalds
Date: Tue May 26 2020 - 17:47:22 EST

On Tue, May 26, 2020 at 2:41 PM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> Almost all users of swait have historically been buggy and/or
> pointless.

Yeah, looking at this one, it really seems to fundamentally fall in
the "pointless" category.

So yeah - instead of extending swait with a new primitive that nobody
else wants than this pointless case, just don't use swait at all.

We have better models. We have "rcuwait", and we have
"wake_up_process()". Either of which is simpler and more efficient
than swait, and are actually useful. rcuwait isn't exactly widely
used, but it has very nice semantics for when that is what you want.
And wake_up_process() is both simple and straightforward, particularly
when you already have a spinlock for protecting whatever state it is
you're waking up on or waiting for.