Re: [RFC v2][PATCH] create workqueue threads only when needed

Oleg Nesterov
2009-01-29T05:02:01Z

On 01/29, Frederic Weisbecker wrote:
>
> I was about to retry the same approach but through async functions (kernel/async.c)
> which would have solved the possible deadlock you described and would have made
> the synchronizations easier.
>
> But actually this is only a half solution:
>
> Pointless workqueues stay pointless, even if they don't appear before they run once.
> And moreover this is hiding the real problem: parts of the kernel use dedicated workqueues
> while kevent is sufficient most of the time.
>
> And if there are problems with using the workqueues, because of deadlocks or slow
> works, async functions are a good solution.

Completely agreed.

And. Even if some subsystem really needs its own workqueue, probably it
can use the single-threaded one, but we have a lot of multithreaded wqs.

Oleg.