[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B300C01.8080904@kernel.org>
Date: Tue, 22 Dec 2009 09:00:01 +0900
From: Tejun Heo <tj@...nel.org>
To: Arjan van de Ven <arjan@...ux.intel.com>
CC: Jens Axboe <jens.axboe@...cle.com>,
Andi Kleen <andi@...stfloor.org>,
Peter Zijlstra <peterz@...radead.org>,
torvalds@...ux-foundation.org, awalls@...ix.net,
linux-kernel@...r.kernel.org, jeff@...zik.org, mingo@...e.hu,
akpm@...ux-foundation.org, rusty@...tcorp.com.au,
cl@...ux-foundation.org, dhowells@...hat.com, avi@...hat.com,
johannes@...solutions.net
Subject: Re: workqueue thing
Hello,
On 12/22/2009 12:19 AM, Arjan van de Ven wrote:
> 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 ? ;-)
That's the way workqueues have been designed and used because its
primary purpose is to supply sleepable context and for that crossing
cpu boundaries is unnecessary overhead, so many of its users wouldn't
benefit from load balancing and some of them assume strong CPU
affinity. cmwq's goal is to improve workqueues. If you want to
implement something which would take advantage of processing
parallelism, it would need to be a separate mechanism (which may share
the API via out-of-range CPU affinty or something but still a separate
mechanism).
>> 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)
Yeah, sure, it's not suited for offloading CPU intensive workloads
(checksumming and encryption basically). Workqueue interface was
never meant to be used by them - it has strong cpu affinity. We need
something which is more parallelism aware for those.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists