Re: workqueue thing

From: Stijn Devriendt
Date: Wed Dec 23 2009 - 03:31:16 EST


On Tue, Dec 22, 2009 at 12:50 AM, Tejun Heo <tj@xxxxxxxxxx> wrote:
>>  2) doesn't deal with cpu heavy tasks/wakeup parallelism
>
> workqueue was never suited for this.  MT workqueues have strong CPU
> affinity which doesn't make sense for CPU-heavy workloads.

It does, really. Have a look at TBB and others. You always want to keep
workqueue items as close to the scheduling thread as possible as the
chance of having a hot cache and TLBs and such are far greater.
The end result is CPU-affine threads fetching work from CPU-affine
queues with workitems scheduled by a thread on that CPU.
To improve parallellism, workqueue threads with empty workqueues
start stealing work away from non-empty workqueues.
The added warmup doesn't weigh in against the added parallellism
in those cases.

Stijn
--
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/