From 9dfdd9ac17ac9955b431cb962df3d0492384ba0e Mon Sep 17 00:00:00 2001 From: Mitch Luban Date: Wed, 25 Jul 2012 12:59:04 -0700 Subject: workqueue: CPU hotplug keep idle workers This change merges two patchsets. The first set, containing 6 patches, reimplements WQ_HIGHPRI to use a seperate worker_pool. gcwq->pools[0] is used for normal priority work and pools[1] for high priority. The second patchset contains 9 patches and reimplements CPU hotplug to keep idle workers. Updates workqueue CPU hotplug path to use a disassociated global_cwq, which runs as an unbound one (WQ_UNBOUND). While this requires rebinding idle workers, overall hotplug path is much simpler. Original patchset: http://thread.gmane.org/gmane.linux.kernel/1329164 Bug 978010 Change-Id: Ic66ec8848a8d111b5278e63ef6a410846dfd8fcc Signed-off-by: Mitch Luban Reviewed-on: http://git-master/r/118387 Reviewed-by: Diwakar Tundlam Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Peter Boonstoppel GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani --- include/linux/cpu.h | 5 +++-- include/trace/events/workqueue.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 54d948ec49ab..d732be526293 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -66,8 +66,9 @@ enum { /* migration should happen before other stuff but after perf */ CPU_PRI_PERF = 20, CPU_PRI_MIGRATION = 10, - /* prepare workqueues for other notifiers */ - CPU_PRI_WORKQUEUE = 5, + /* bring up workqueues before normal notifiers and down after */ + CPU_PRI_WORKQUEUE_UP = 5, + CPU_PRI_WORKQUEUE_DOWN = -5, }; #define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */ diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h index 7d497291c85d..82f61f4ce7a7 100644 --- a/include/trace/events/workqueue.h +++ b/include/trace/events/workqueue.h @@ -54,7 +54,7 @@ TRACE_EVENT(workqueue_queue_work, __entry->function = work->func; __entry->workqueue = cwq->wq; __entry->req_cpu = req_cpu; - __entry->cpu = cwq->gcwq->cpu; + __entry->cpu = cwq->pool->gcwq->cpu; ), TP_printk("work struct=%p function=%pf workqueue=%p req_cpu=%u cpu=%u", -- cgit v1.2.3