Re: workqueue thing

Arjan van de Ven
2009-12-21T15:20:12Z

On 12/21/2009 15:19, Tejun Heo wrote:
>
> Ah... okay, there are two aspects cmwq invovles the scheduler.
>
> A. Concurrency management. This is achieved by the scheduler
> callbacks which watches how many workers are working.
>
> B. Deadlock avoidance. This requires migrating rescuers to CPUs under
> allocation distress. The problem here is that
> set_cpus_allowed_ptr() doesn't allow migrating tasks to CPUs which
> are online but !active (CPU_DOWN_PREPARE).

why would you get involved in what-runs-where at all? Wouldn't the scheduler
load balancer be a useful thing ? ;-)

>
> For A, it's far more efficient and robust with scheduler callbacks.
> It's conceptually pretty simple too.

Assuming you don't get tasks that do lots of cpu intense work and that need
to get preempted etc...like raid5/6 sync but also the btrfs checksumming etc etc.
That to me is the weak spot of the scheduler callback thing. We already have
a whole thing that knows how to load balance and preempt tasks... it's called "scheduler".
Let the scheduler do its job and just give it insight in the work (by having a runnable thread)