Re: workqueue thing

Arjan van de Ven
2009-12-18T15:01:44Z

On 12/18/2009 5:50, Andi Kleen wrote:
>> The only way something can be not cpu intensive and long 'running' is if
>> it got blocked that long, and the right solution is to fix that
>> contention, things should not be blocked for seconds.
>
> Work queue items shouldn't be blocking for seconds in the normal case, but it might
> always happen in the exceptional case (e.g. handling some error condition).
> In this case it would be good if the other jobs wouldn't be too
> disrupted and the whole setup degrades gracefully.

in addition, threads are cheap. Linux has no technical problem with running 100's of kernel threads
(if not 1000s); they cost basically a task struct and a stack (2 pages) each and that's about it.
making an elaborate-and-thus-fragile design to save a few kernel threads is likely a bad design direction...