Re: Overview of concurrency managed workqueue

From: Tejun Heo
Date: Sat Jun 19 2010 - 05:03:05 EST


Hello,

On 06/19/2010 10:55 AM, Andi Kleen wrote:
> Tejun Heo <tj@xxxxxxxxxx> writes:
>>
>> Wouldn't that be better served by cpu_stop?
>
> No the error handling has to be able to sleep to take VM
> locks. That's the whole point its handed off to a
> workqueue. Otherwise it could be done directly.

I see. The thing is that if you have "as soon as possible" + "high
priority", you're basically required to have a dedicated worker or
dedicated pool of them. Making cmwq to support some level of priority
definitely is possible (multiple prioritized queues or pushing work at
the front at the simplest) but for such emergency works it doesn't
make sense to share the usual worker pool, as resource pressure can
easily make any work wait regardless of where they're in the queue.

If there are multiple of such use cases, it would make sense to create
a prioritized worker pools along with prioritized per-cpu queues but
if there are only a few of them, I think it makes more sense to use
dedicated threads for them. Do those threads need to be per-cpu?

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/