public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Assign CPUs to nodes in round-robin manner on Fake NUMA.
@ 2010-09-30 12:04 Nikanth Karthikesan
  2010-10-07  7:42 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Nikanth Karthikesan @ 2010-09-30 12:04 UTC (permalink / raw)
  To: linux-kernel, x86
  Cc: Yinghai Lu, Ingo Molnar, H. Peter Anvin, Thomas Gleixner

Assign CPUs to nodes in round-robin manner on Fake NUMA.

commit d9c2d5ac6af87b4491bff107113aaf16f6c2b2d9
"x86, numa: Use near(er) online node instead of roundrobin for NUMA"
changed NUMA initialization on Intel to choose the nearest online node or
first node. Fake NUMA would be better of with round-robin initialization,
instead of the all CPUS on first node. Change the choice of first node, back
to round-robin.

Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>

---

diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 85f69cd..47dd171 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -283,9 +283,7 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
 	/* Don't do the funky fallback heuristics the AMD version employs
 	   for now. */
 	node = apicid_to_node[apicid];
-	if (node == NUMA_NO_NODE)
-		node = first_node(node_online_map);
-	else if (!node_online(node)) {
+	if (node == NUMA_NO_NODE || !node_online(node)) {
 		/* reuse the value from init_cpu_to_node() */
 		node = cpu_to_node(cpu);
 	}

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

* Re: [PATCH] Assign CPUs to nodes in round-robin manner on Fake NUMA.
  2010-09-30 12:04 [PATCH] Assign CPUs to nodes in round-robin manner on Fake NUMA Nikanth Karthikesan
@ 2010-10-07  7:42 ` Andrew Morton
  2010-10-08  5:53   ` Nikanth Karthikesan
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2010-10-07  7:42 UTC (permalink / raw)
  To: Nikanth Karthikesan
  Cc: linux-kernel, x86, Yinghai Lu, Ingo Molnar, H. Peter Anvin,
	Thomas Gleixner

On Thu, 30 Sep 2010 17:34:10 +0530 Nikanth Karthikesan <knikanth@suse.de> wrote:

> Assign CPUs to nodes in round-robin manner on Fake NUMA.
> 
> commit d9c2d5ac6af87b4491bff107113aaf16f6c2b2d9
> "x86, numa: Use near(er) online node instead of roundrobin for NUMA"
> changed NUMA initialization on Intel to choose the nearest online node or
> first node. Fake NUMA would be better of with round-robin initialization,
> instead of the all CPUS on first node. Change the choice of first node, back
> to round-robin.
> 

Why would fake NUMA "be better off with round-robin initialization"?

> 
> ---
> 
> diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
> index 85f69cd..47dd171 100644
> --- a/arch/x86/kernel/cpu/intel.c
> +++ b/arch/x86/kernel/cpu/intel.c
> @@ -283,9 +283,7 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
>  	/* Don't do the funky fallback heuristics the AMD version employs
>  	   for now. */
>  	node = apicid_to_node[apicid];
> -	if (node == NUMA_NO_NODE)
> -		node = first_node(node_online_map);
> -	else if (!node_online(node)) {
> +	if (node == NUMA_NO_NODE || !node_online(node)) {
>  		/* reuse the value from init_cpu_to_node() */
>  		node = cpu_to_node(cpu);
>  	}
> --
> 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/

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

* Re: [PATCH] Assign CPUs to nodes in round-robin manner on Fake NUMA.
  2010-10-07  7:42 ` Andrew Morton
@ 2010-10-08  5:53   ` Nikanth Karthikesan
  0 siblings, 0 replies; 3+ messages in thread
From: Nikanth Karthikesan @ 2010-10-08  5:53 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, x86, Yinghai Lu, Ingo Molnar, H. Peter Anvin,
	Thomas Gleixner

On Thursday 07 October 2010 13:12:52 Andrew Morton wrote:
> On Thu, 30 Sep 2010 17:34:10 +0530 Nikanth Karthikesan <knikanth@suse.de> 
wrote:
> > Assign CPUs to nodes in round-robin manner on Fake NUMA.
> >
> > commit d9c2d5ac6af87b4491bff107113aaf16f6c2b2d9
> > "x86, numa: Use near(er) online node instead of roundrobin for NUMA"
> > changed NUMA initialization on Intel to choose the nearest online node or
> > first node. Fake NUMA would be better of with round-robin initialization,
> > instead of the all CPUS on first node. Change the choice of first node,
> > back to round-robin.
> 
> Why would fake NUMA "be better off with round-robin initialization"?
> 

For testing NUMA kernel behaviour without cpusets and NUMA aware applications, 
it would be better to have cpus in different nodes, rather than all in a 
single node. With cpusets migration of tasks scenarios cannot not be tested.

I guess having it round-robin shouldn't affect the use cases for all cpus on 
the first node.

>From the code comments in arch/x86/mm/numa_64.c:759 looks like this used to be 
the case, which was changed by commit d9c2d5ac6. It changed from roundrobin to 
nearer or first node. And I couldn't find any reason for this change in its 
changelog.

Thanks
Nikanth

> > ---
> >
> > diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
> > index 85f69cd..47dd171 100644
> > --- a/arch/x86/kernel/cpu/intel.c
> > +++ b/arch/x86/kernel/cpu/intel.c
> > @@ -283,9 +283,7 @@ static void __cpuinit srat_detect_node(struct
> > cpuinfo_x86 *c) /* Don't do the funky fallback heuristics the AMD version
> > employs for now. */
> >  	node = apicid_to_node[apicid];
> > -	if (node == NUMA_NO_NODE)
> > -		node = first_node(node_online_map);
> > -	else if (!node_online(node)) {
> > +	if (node == NUMA_NO_NODE || !node_online(node)) {
> >  		/* reuse the value from init_cpu_to_node() */
> >  		node = cpu_to_node(cpu);
> >  	}
> > --
> > 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/
> 

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

end of thread, other threads:[~2010-10-08  5:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-30 12:04 [PATCH] Assign CPUs to nodes in round-robin manner on Fake NUMA Nikanth Karthikesan
2010-10-07  7:42 ` Andrew Morton
2010-10-08  5:53   ` Nikanth Karthikesan

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