lkml.org 
[lkml]   [2005]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] kthread_bind new worker threads when onlining cpu
Hi Andrew-

On Tue, Feb 15, 2005 at 08:02:17AM +0100, Ingo Molnar wrote:
>
> * Nathan Lynch <ntl@pobox.com> wrote:
>
> >
> > It looks as if we need to explicitly bind worker threads to a newly
> > onlined cpu. This gets rid of the smp_processor_id warnings from
> > cache_reap. Adding a little more instrumentation to the debug
> > smp_processor_id showed that new worker threads were actually running
> > on the wrong cpu...
> >
> > Does this look ok?
>
> indeed - looks much better than the 'turn off the warning' solution.
>
> Acked-by: Ingo Molnar <mingo@elte.hu>

We weren't binding new worker threads to their cpu when onlining.
Using preempt and the debug version of smp_processor_id found this.

Signed-off-by: Nathan Lynch <ntl@pobox.com>

Index: linux-2.6.11-rc4-bk2/kernel/workqueue.c
===================================================================
--- linux-2.6.11-rc4-bk2.orig/kernel/workqueue.c 2005-02-14 11:13:08.000000000 -0600
+++ linux-2.6.11-rc4-bk2/kernel/workqueue.c 2005-02-14 15:18:35.000000000 -0600
@@ -485,8 +485,10 @@

case CPU_ONLINE:
/* Kick off worker threads. */
- list_for_each_entry(wq, &workqueues, list)
+ list_for_each_entry(wq, &workqueues, list) {
+ kthread_bind(wq->cpu_wq[hotcpu].thread, hotcpu);
wake_up_process(wq->cpu_wq[hotcpu].thread);
+ }
break;

case CPU_UP_CANCELED:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.075 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site