[lkml]   [2012]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCHSET] workqueue: reimplement CPU hotplug to keep idle workers
Hey, Peter.

On Fri, Jul 20, 2012 at 05:48:31PM +0200, Peter Zijlstra wrote:
> On Tue, 2012-07-17 at 10:12 -0700, Tejun Heo wrote:
> > While this makes rebinding somewhat more complicated, as it has to be
> > able to rebind idle workers too, it allows overall hotplug path to be
> > much simpler.
> I really don't see the point of re-binding.. at that point you've well
> and proper violated any per-cpu expectation, so why not complete running
> the works on the disassociated thing and let new works accrue on the
> per-cpu things again?

We've discussed this a couple times now, so the existing reasons were,

* Local affinity is more often used as a form of affinity optimization
since the beginning. This, mixed with queue_work() /
queue_work_on(), does make things muddy.

* With local affinity used for optimization, we better support
detaching running workers - before cmwq, this used to be one of the
sources of trouble during power state changes.

* So, we have unbound workers which started as bound while a CPU is
down. When the CPU comes back up again, we can do one of the
followings - 1. migrate the unbound ones to WORK_CPU_UNBOUND (can
also do this on CPU_DOWN), 2. leave them unbound and keep them
running in parallel with bound ones, or 3. rebind them. #2 is the
hariest - it contaminates the usual !hotplug code paths. #1 or #3,
unsure, but given how global_cwq's don't usually interact with each
other, I thought #3 would be lower impact on hot paths.

So, the above was my rationale before this "we need to stop destroying
and re-creating kthreads across CPU hotplug events because phones do
it gazillion times". Now, I don't think we have any other way.



 \ /
  Last update: 2012-07-20 19:41    [W:0.151 / U:3.744 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site