Re: workqueue thing

Peter Zijlstra
2009-12-22T18:21:37Z

On Tue, 2009-12-22 at 19:07 +0100, Andi Kleen wrote:

> 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.

What you want is something that does not block, but does not generate
more load than a single runnable task either. Otherwise you'll end up
with massive load issues.

The thing currently proposed only does the first, but does not guarantee
the latter. Meaning you can only use it if you know it will not do much
work (after blocking), which is a fine restriction in the kernel (not
something I think the current workqueue users all adhere to though).

However, it is not something you'd want to expose to userspace, not that
is, without the counterpart limiting wakeup parallelism.

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

What are those?

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

And here I though btrfs was one of those who did actually consume heaps
of CPU in its worklets doing data checksums and the like.