Re: workqueue thing

Andi Kleen
2009-12-22T18:07:07Z

> 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@linux.intel.com -- Speaking for myself only.