Re: workqueue thing

From: Andi Kleen
Date: Tue Dec 22 2009 - 13:07:14 EST


> I've seen those consume significant amounts of cpu, now I'm not going to
> argue that workqueues are not the best way to consume lots of cpu, but
> the fact is they _are_ used for that.

AFAIK they currently have the following problems:
- Consuming CPU in shared work queues is a bad idea for obvious reasons
(but I don't think anybody does that)
- Single threaded work is well, single threaded and does not scale
and wastes cores.
- Per CPU work queues are bound to each CPU so that the scheduler
cannot properly load balance (so you might end up with over/under
subscribed CPUs)

One reason I liked a more dynamic frame work for this is that it
has the potential to be exposed to user space and allow automatic
work partitioning there based on available cores. User space
has a lot more CPU consumption than the kernel.

I think Grand Central Dispatch does something in this direction.
TBB would probably also benfit

Short term an alternative for the kernel would be also
to generalize the simple framework that is in btrfs.

-Andi
--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
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/