Re: Overview of concurrency managed workqueue

From: Tejun Heo
Date: Thu Jun 17 2010 - 04:29:44 EST


Hello,

On 06/17/2010 07:29 AM, Florian Mickler wrote:
> Once you have the priority in the driver you could pass it to the
> workqueue subsystem (i.e. set the priority of the work) and the worker
> could then assume the priority of its work.
>
> The tricky part is probably to pass the priority from the userspace
> thread to the kernel?

There are several things to consider. First of all, workqueue
latencies would be much lower with cmwq because works don't need to
wait for other works on the same wq to complete. So, in general, the
latencies will be more predictable and lower.

Secondly, work items don't tend to burn a lot of cpu cycles. Combined
with the first point, there might not be much benefit to doing all the
extra work for prioritizing work items (as what matters is getting
them to start running quickly and cmwq helps a lot in that direction).

Thirdly, on !RT kernel, RT doesn't have any guarantee anyway. It's
just higher priority. For real RT, if work items should be capable of
being part of critical path, implementing proper priority inheritance
is necessary so that flush_work() and possibly flush_workqueue() can
bump the waited works on behalf of RT thread waiting on them. Whether
that would be a worth investment or just not using work items in
critical path is better, I don't know.

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/