All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -tip] rcu: use kthread_create_on_node()
@ 2011-05-19  8:32 Eric Dumazet
  2011-05-20 23:23 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2011-05-19  8:32 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: linux-kernel, Tejun Heo, Rusty Russell, Andrew Morton,
	Andi Kleen, Ingo Molnar

Commit a26ac2455ffc (move TREE_RCU from softirq to kthread) added
creation of per cpu kthreads.

Use kthread_create_on_node() NUMA friendly function, to let these
threads use local node for their stack/task struct.

We did a similar change in commit 94dcf29a11b3 (kthread: use
kthread_create_on_node())

Also change rcu torture kthread creation.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Tejun Heo <tj@kernel.org>
CC: Rusty Russell <rusty@rustcorp.com.au>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Andi Kleen <ak@linux.intel.com>
CC: Ingo Molnar <mingo@elte.hu>
---
 kernel/rcutorture.c |    3 ++-
 kernel/rcutree.c    |    5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index 2e138db..40d9ed2 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -1282,7 +1282,8 @@ static int rcutorture_booster_init(int cpu)
 	/* Don't allow time recalculation while creating a new task. */
 	mutex_lock(&boost_mutex);
 	VERBOSE_PRINTK_STRING("Creating rcu_torture_boost task");
-	boost_tasks[cpu] = kthread_create(rcu_torture_boost, NULL,
+	boost_tasks[cpu] = kthread_create_on_node(rcu_torture_boost, NULL,
+						  cpu_to_node(cpu),
 					  "rcu_torture_boost");
 	if (IS_ERR(boost_tasks[cpu])) {
 		retval = PTR_ERR(boost_tasks[cpu]);
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 5616b17..b013915 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1649,7 +1649,10 @@ static int __cpuinit rcu_spawn_one_cpu_kthread(int cpu)
 	if (!rcu_kthreads_spawnable ||
 	    per_cpu(rcu_cpu_kthread_task, cpu) != NULL)
 		return 0;
-	t = kthread_create(rcu_cpu_kthread, (void *)(long)cpu, "rcuc%d", cpu);
+	t = kthread_create_on_node(rcu_cpu_kthread,
+				   (void *)(long)cpu,
+				   cpu_to_node(cpu),
+				   "rcuc%d", cpu);
 	if (IS_ERR(t))
 		return PTR_ERR(t);
 	kthread_bind(t, cpu);



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

* Re: [PATCH -tip] rcu: use kthread_create_on_node()
  2011-05-19  8:32 [PATCH -tip] rcu: use kthread_create_on_node() Eric Dumazet
@ 2011-05-20 23:23 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2011-05-20 23:23 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: linux-kernel, Tejun Heo, Rusty Russell, Andrew Morton,
	Andi Kleen, Ingo Molnar

On Thu, May 19, 2011 at 10:32:45AM +0200, Eric Dumazet wrote:
> Commit a26ac2455ffc (move TREE_RCU from softirq to kthread) added
> creation of per cpu kthreads.
> 
> Use kthread_create_on_node() NUMA friendly function, to let these
> threads use local node for their stack/task struct.
> 
> We did a similar change in commit 94dcf29a11b3 (kthread: use
> kthread_create_on_node())
> 
> Also change rcu torture kthread creation.

Queued, thank you, Eric!

							Thanx, Paul

> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: Tejun Heo <tj@kernel.org>
> CC: Rusty Russell <rusty@rustcorp.com.au>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: Andi Kleen <ak@linux.intel.com>
> CC: Ingo Molnar <mingo@elte.hu>
> ---
>  kernel/rcutorture.c |    3 ++-
>  kernel/rcutree.c    |    5 ++++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
> index 2e138db..40d9ed2 100644
> --- a/kernel/rcutorture.c
> +++ b/kernel/rcutorture.c
> @@ -1282,7 +1282,8 @@ static int rcutorture_booster_init(int cpu)
>  	/* Don't allow time recalculation while creating a new task. */
>  	mutex_lock(&boost_mutex);
>  	VERBOSE_PRINTK_STRING("Creating rcu_torture_boost task");
> -	boost_tasks[cpu] = kthread_create(rcu_torture_boost, NULL,
> +	boost_tasks[cpu] = kthread_create_on_node(rcu_torture_boost, NULL,
> +						  cpu_to_node(cpu),
>  					  "rcu_torture_boost");
>  	if (IS_ERR(boost_tasks[cpu])) {
>  		retval = PTR_ERR(boost_tasks[cpu]);
> diff --git a/kernel/rcutree.c b/kernel/rcutree.c
> index 5616b17..b013915 100644
> --- a/kernel/rcutree.c
> +++ b/kernel/rcutree.c
> @@ -1649,7 +1649,10 @@ static int __cpuinit rcu_spawn_one_cpu_kthread(int cpu)
>  	if (!rcu_kthreads_spawnable ||
>  	    per_cpu(rcu_cpu_kthread_task, cpu) != NULL)
>  		return 0;
> -	t = kthread_create(rcu_cpu_kthread, (void *)(long)cpu, "rcuc%d", cpu);
> +	t = kthread_create_on_node(rcu_cpu_kthread,
> +				   (void *)(long)cpu,
> +				   cpu_to_node(cpu),
> +				   "rcuc%d", cpu);
>  	if (IS_ERR(t))
>  		return PTR_ERR(t);
>  	kthread_bind(t, cpu);
> 
> 

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

end of thread, other threads:[~2011-05-20 23:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-19  8:32 [PATCH -tip] rcu: use kthread_create_on_node() Eric Dumazet
2011-05-20 23:23 ` Paul E. McKenney

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.