The patch titled Handle CPU_LOCK_ACQUIRE and CPU_LOCK_RELEASE in workqueue_cpu_callback has been added to the -mm tree. Its filename is handle-cpu_lock_acquire-and-cpu_lock_release-in-workqueue_cpu_callback.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: Handle CPU_LOCK_ACQUIRE and CPU_LOCK_RELEASE in workqueue_cpu_callback From: Gautham R Shenoy <ego@xxxxxxxxxx> In hot-cpu callback function workqueue_cpu_callback, lock the workqueue_mutex under CPU_LOCK_ACQUIRE and release it under CPU_LOCK_RELEASE. This eliminates handling of redundant events namely CPU_DOWN_PREPARE and CPU_DOWN_FAILED. Signed-off-by: Gautham R Shenoy <ego@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- kernel/workqueue.c | 18 +++++++----------- 1 files changed, 7 insertions(+), 11 deletions(-) diff -puN kernel/workqueue.c~handle-cpu_lock_acquire-and-cpu_lock_release-in-workqueue_cpu_callback kernel/workqueue.c --- a/kernel/workqueue.c~handle-cpu_lock_acquire-and-cpu_lock_release-in-workqueue_cpu_callback +++ a/kernel/workqueue.c @@ -651,8 +651,11 @@ static int __devinit workqueue_cpu_callb struct workqueue_struct *wq; switch (action) { - case CPU_UP_PREPARE: + case CPU_LOCK_ACQUIRE: mutex_lock(&workqueue_mutex); + break; + + case CPU_UP_PREPARE: /* Create a new workqueue thread for it. */ list_for_each_entry(wq, &workqueues, list) { if (!create_workqueue_thread(wq, hotcpu)) { @@ -671,7 +674,6 @@ static int __devinit workqueue_cpu_callb kthread_bind(cwq->thread, hotcpu); wake_up_process(cwq->thread); } - mutex_unlock(&workqueue_mutex); break; case CPU_UP_CANCELED: @@ -683,15 +685,6 @@ static int __devinit workqueue_cpu_callb any_online_cpu(cpu_online_map)); cleanup_workqueue_thread(wq, hotcpu); } - mutex_unlock(&workqueue_mutex); - break; - - case CPU_DOWN_PREPARE: - mutex_lock(&workqueue_mutex); - break; - - case CPU_DOWN_FAILED: - mutex_unlock(&workqueue_mutex); break; case CPU_DEAD: @@ -699,6 +692,9 @@ static int __devinit workqueue_cpu_callb cleanup_workqueue_thread(wq, hotcpu); list_for_each_entry(wq, &workqueues, list) take_over_work(wq, hotcpu); + break; + + case CPU_LOCK_RELEASE: mutex_unlock(&workqueue_mutex); break; } _ Patches currently in -mm which might be from ego@xxxxxxxxxx are git-cpufreq.patch extend-notifier_call_chain-to-count-nr_calls-made.patch define-and-use-new-eventscpu_lock_acquire-and-cpu_lock_release.patch define-and-use-new-eventscpu_lock_acquire-and-cpu_lock_release-fix.patch eliminate-lock_cpu_hotplug-in-kernel-schedc.patch handle-cpu_lock_acquire-and-cpu_lock_release-in-workqueue_cpu_callback.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html