public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET wq/for-3.10] workqueue: simplify per-cpu worker rebinding and implement unbound worker CPU affinity restoration
@ 2013-03-14 23:01 Tejun Heo
  2013-03-14 23:01 ` [PATCH REVIEW_ONLY 1/5] sched: replace PF_THREAD_BOUND with PF_NO_SETAFFINITY Tejun Heo
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Tejun Heo @ 2013-03-14 23:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: laijs

Hello,

per-cpu worker rebinding on CPU_ONLINE has always been complex.  A lot
of the complexity comes from the fact that CPU_ONLINE should ask each
worker, which may be in any state, to rebind itself.  With recent
patch to replace PF_THREAD_BOUND with PF_NO_SETAFFINITY (the patch is
pending and included here for review), CPU_ONLINE can directly invoke
set_cpus_allowed_ptr() on the workers.

This patchset simplifies rebinding of per-cpu workers by making
CPU_ONLINE directly call set_cpus_allowed_ptr() on the workers and
implements CPU affinity restoration of unbound workers.  The latter is
necessary because unbound pools can now have custom cpumask and if all
CPUs in the allowed cpumask go down and then later come up, workers
may lose affinity.  This patchset makes workqueue CPU_ONLINE callback
restore CPU affinity when the first allowed CPU comes up for a pool.

This patchset contains the following five patches.

 0001-sched-replace-PF_THREAD_BOUND-with-PF_NO_SETAFFINITY.patch
 0002-workqueue-convert-worker_pool-worker_ida-to-idr-and-.patch
 0003-workqueue-relocate-rebind_workers.patch
 0004-workqueue-directly-restore-CPU-affinity-of-workers-f.patch
 0005-workqueue-restore-CPU-affinity-of-unbound-workers-on.patch

0001 doesn't belong in this series.  It was posted separately[1] and
should be routed through tip.

  wq/for-3.10 e626761691 ("workqueue: implement current_is_workqueue_rescuer()")
+ "workqueue: misc cleanups" patchset [2]
+ "workqueue: workqueue: break up workqueue_lock into multiple locks [3]

and available in the following git branch.

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

diffstat follows.

 include/linux/sched.h       |    2
 kernel/cgroup.c             |    4
 kernel/cpuset.c             |   16 +-
 kernel/kthread.c            |    2
 kernel/sched/core.c         |    9 -
 kernel/workqueue.c          |  351 ++++++++++++++++++++++----------------------
 kernel/workqueue_internal.h |    3
 7 files changed, 198 insertions(+), 189 deletions(-)

Thanks.

--
tejun

[1] http://article.gmane.org/gmane.linux.kernel/1457229
[2] http://thread.gmane.org/gmane.linux.kernel/1456511
[3] http://thread.gmane.org/gmane.linux.kernel/1456555

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

end of thread, other threads:[~2013-03-19 20:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-14 23:01 [PATCHSET wq/for-3.10] workqueue: simplify per-cpu worker rebinding and implement unbound worker CPU affinity restoration Tejun Heo
2013-03-14 23:01 ` [PATCH REVIEW_ONLY 1/5] sched: replace PF_THREAD_BOUND with PF_NO_SETAFFINITY Tejun Heo
2013-03-14 23:01 ` [PATCH 2/5] workqueue: convert worker_pool->worker_ida to idr and implement for_each_pool_worker() Tejun Heo
2013-03-14 23:01 ` [PATCH 3/5] workqueue: relocate rebind_workers() Tejun Heo
2013-03-14 23:01 ` [PATCH 4/5] workqueue: directly restore CPU affinity of workers from CPU_ONLINE Tejun Heo
2013-03-14 23:01 ` [PATCH 5/5] workqueue: restore CPU affinity of unbound workers on CPU_ONLINE Tejun Heo
2013-03-19 20:49 ` [PATCHSET wq/for-3.10] workqueue: simplify per-cpu worker rebinding and implement unbound worker CPU affinity restoration Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox