All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET] workqueue: reimplement CPU hotplug to keep idle workers
@ 2012-07-17 17:12 Tejun Heo
  2012-07-17 17:12 ` [PATCH 1/9] workqueue: perform cpu down operations from low priority cpu_notifier() Tejun Heo
                   ` (11 more replies)
  0 siblings, 12 replies; 33+ messages in thread
From: Tejun Heo @ 2012-07-17 17:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: torvalds, peterz, tglx, linux-pm

Currently, workqueue destroys all workers for offline CPUs unless
there are lingering work items.  On some platforms, CPU hotplugs are
used as part of runtime powersaving and thus can be very frequent.
The overhead of destroying and re-creating workers on each cycle can
be noticeable.

In addition, being different from the usual mode of opration,
kill-all-idle involves separate driving logic, which currently is
implemented across trustee_thread() and CPU hotplug notifier.  This is
rather complex and ugly.

This patchset updates workqueue CPU hotplug path such that a
disassociated global_cwq (the per-cpu worker pool) is run as if it's
running as an unbound one (WQ_UNBOUND) - executing work items ASAP
without concurrency management while following the usual worker
management based on idle timer.

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.  A disassociating global_cwq simply becomes an unbound
one at the end of CPU_DOWN_PREPARE and makes use of the same logic
already existing for WQ_UNBOUND.  While re-associating, it switches
back to a bound one.  Except during the transitions themselves, the
usual worker management is always in effect making trustee
unnecessary.

 0001-workqueue-perform-cpu-down-operations-from-low-prior.patch
 0002-workqueue-drop-CPU_DYING-notifier-operation.patch
 0003-workqueue-ROGUE-workers-are-UNBOUND-workers.patch
 0004-workqueue-use-mutex-for-global_cwq-manager-exclusion.patch
 0005-workqueue-drop-bind-from-create_worker.patch
 0006-workqueue-reimplement-CPU-online-rebinding-to-handle.patch
 0007-workqueue-don-t-butcher-idle-workers-on-an-offline-C.patch
 0008-workqueue-remove-CPU-offline-trustee.patch
 0009-workqueue-simplify-CPU-hotplug-code.patch

0001 is fix for an unlikely race condition.  0002-0005 prepare for CPU
hotplug reimplementation.  0006 reimplements re-binding such that it
can handle idle workers too.  0007 drops killing idle workers of
offline CPUs.  0008 replaces trustee with the usual management logic.
0009 refactors hotplug path a bit to clean it up.

This patchset is on top of "workqueue: reimplement high priority using
a separate worker pool" patchset[1] and available on the following git
branch.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git review-wq-hotplug

 include/linux/cpu.h |    5 
 kernel/workqueue.c  |  738 ++++++++++++++++++++--------------------------------
 2 files changed, 296 insertions(+), 447 deletions(-)

Thanks.

--
tejun

[1] http://lwn.net/Articles/506029/

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2012-07-23  8:39 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-17 17:12 [PATCHSET] workqueue: reimplement CPU hotplug to keep idle workers Tejun Heo
2012-07-17 17:12 ` [PATCH 1/9] workqueue: perform cpu down operations from low priority cpu_notifier() Tejun Heo
2012-07-20 21:52   ` Paul E. McKenney
2012-07-20 21:58     ` Tejun Heo
2012-07-21 21:36       ` Paul E. McKenney
2012-07-22 16:43         ` [PATCH] workqueue: fix spurious CPU locality WARN from process_one_work() Tejun Heo
2012-07-22 21:23           ` Paul E. McKenney
2012-07-17 17:12 ` [PATCH 2/9] workqueue: drop CPU_DYING notifier operation Tejun Heo
2012-07-17 17:12 ` [PATCH 3/9] workqueue: ROGUE workers are UNBOUND workers Tejun Heo
2012-07-17 17:12 ` [PATCH 4/9] workqueue: use mutex for global_cwq manager exclusion Tejun Heo
2012-07-17 17:12 ` [PATCH 5/9] workqueue: drop @bind from create_worker() Tejun Heo
2012-07-17 17:12 ` [PATCH 6/9] workqueue: reimplement CPU online rebinding to handle idle workers Tejun Heo
2012-07-17 17:12 ` [PATCH 7/9] workqueue: don't butcher idle workers on an offline CPU Tejun Heo
2012-07-17 17:12 ` [PATCH 8/9] workqueue: remove CPU offline trustee Tejun Heo
2012-07-17 17:12 ` [PATCH 9/9] workqueue: simplify CPU hotplug code Tejun Heo
2012-07-17 18:43 ` [PATCHSET] workqueue: reimplement CPU hotplug to keep idle workers Rafael J. Wysocki
2012-07-17 19:40   ` Tejun Heo
2012-07-20 15:48 ` Peter Zijlstra
2012-07-20 17:02   ` Tejun Heo
2012-07-20 17:21     ` Peter Zijlstra
2012-07-20 17:50       ` Tejun Heo
2012-07-20 18:22         ` Peter Zijlstra
2012-07-20 18:34           ` Tejun Heo
2012-07-20 19:44             ` Rafael J. Wysocki
2012-07-20 19:41               ` Tejun Heo
2012-07-21  6:42               ` Shilimkar, Santosh
2012-07-23  8:38               ` Peter De Schrijver
2012-07-20 16:39 ` Peter Zijlstra
2012-07-20 16:52   ` Tejun Heo
2012-07-20 17:01     ` Peter Zijlstra
2012-07-20 17:08       ` Tejun Heo
2012-07-20 17:19         ` Peter Zijlstra
2012-07-20 17:43           ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.