All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: fix numa distance for form0 device tree
@ 2013-05-07  3:49 Michael Ellerman
  2013-05-07  4:06 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Michael Ellerman @ 2013-05-07  3:49 UTC (permalink / raw)
  To: stable; +Cc: linuxppc-dev, Anton Blanchard

From: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>

Commit 7122beeee7bc1757682049780179d7c216dd1c83 upstream.

The following commit breaks numa distance setup for old powerpc
systems that use form0 encoding in device tree.

commit 41eab6f88f24124df89e38067b3766b7bef06ddb
powerpc/numa: Use form 1 affinity to setup node distance

Device tree node /rtas/ibm,associativity-reference-points would
index into /cpus/PowerPCxxxx/ibm,associativity based on form0 or
form1 encoding detected by ibm,architecture-vec-5 property.

All modern systems use form1 and current kernel code is correct.
However, on older systems with form0 encoding, the numa distance
will get hard coded as LOCAL_DISTANCE for all nodes.  This causes
task scheduling anomaly since scheduler will skip building numa
level domain (topmost domain with all cpus) if all numa distances
are same.  (value of 'level' in sched_init_numa() will remain 0)

Prior to the above commit:
((from) == (to) ? LOCAL_DISTANCE : REMOTE_DISTANCE)

Restoring compatible behavior with this patch for old powerpc systems
with device tree where numa distance are encoded as form0.

Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/mm/numa.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index bba87ca..6a252c4 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -201,7 +201,7 @@ int __node_distance(int a, int b)
 	int distance = LOCAL_DISTANCE;
 
 	if (!form1_affinity)
-		return distance;
+		return ((a == b) ? LOCAL_DISTANCE : REMOTE_DISTANCE);
 
 	for (i = 0; i < distance_ref_points_depth; i++) {
 		if (distance_lookup_table[a][i] == distance_lookup_table[b][i])
-- 
1.7.10.4

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

* Re: [PATCH] powerpc: fix numa distance for form0 device tree
  2013-05-07  3:49 [PATCH] powerpc: fix numa distance for form0 device tree Michael Ellerman
@ 2013-05-07  4:06 ` Greg KH
  2013-05-07  4:23   ` Michael Ellerman
  2013-05-08 10:29 ` Luis Henriques
  2013-05-10  4:45 ` Ben Hutchings
  2 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2013-05-07  4:06 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Anton Blanchard, stable

On Tue, May 07, 2013 at 01:49:34PM +1000, Michael Ellerman wrote:
> From: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
> 
> Commit 7122beeee7bc1757682049780179d7c216dd1c83 upstream.
> 
> The following commit breaks numa distance setup for old powerpc
> systems that use form0 encoding in device tree.
> 
> commit 41eab6f88f24124df89e38067b3766b7bef06ddb
> powerpc/numa: Use form 1 affinity to setup node distance
> 
> Device tree node /rtas/ibm,associativity-reference-points would
> index into /cpus/PowerPCxxxx/ibm,associativity based on form0 or
> form1 encoding detected by ibm,architecture-vec-5 property.
> 
> All modern systems use form1 and current kernel code is correct.
> However, on older systems with form0 encoding, the numa distance
> will get hard coded as LOCAL_DISTANCE for all nodes.  This causes
> task scheduling anomaly since scheduler will skip building numa
> level domain (topmost domain with all cpus) if all numa distances
> are same.  (value of 'level' in sched_init_numa() will remain 0)
> 
> Prior to the above commit:
> ((from) == (to) ? LOCAL_DISTANCE : REMOTE_DISTANCE)
> 
> Restoring compatible behavior with this patch for old powerpc systems
> with device tree where numa distance are encoded as form0.
> 
> Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
>  arch/powerpc/mm/numa.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

What stable tree should this be applied to?

thanks,

greg k-h

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

* Re: [PATCH] powerpc: fix numa distance for form0 device tree
  2013-05-07  4:06 ` Greg KH
@ 2013-05-07  4:23   ` Michael Ellerman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2013-05-07  4:23 UTC (permalink / raw)
  To: Greg KH; +Cc: linuxppc-dev, Anton Blanchard, stable

On Mon, May 06, 2013 at 09:06:15PM -0700, Greg KH wrote:
> On Tue, May 07, 2013 at 01:49:34PM +1000, Michael Ellerman wrote:
> > From: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
> > 
> > Commit 7122beeee7bc1757682049780179d7c216dd1c83 upstream.
> > 
> > The following commit breaks numa distance setup for old powerpc
> > systems that use form0 encoding in device tree.
> > 
> > commit 41eab6f88f24124df89e38067b3766b7bef06ddb
> > powerpc/numa: Use form 1 affinity to setup node distance
> > 
> > Device tree node /rtas/ibm,associativity-reference-points would
> > index into /cpus/PowerPCxxxx/ibm,associativity based on form0 or
> > form1 encoding detected by ibm,architecture-vec-5 property.
> > 
> > All modern systems use form1 and current kernel code is correct.
> > However, on older systems with form0 encoding, the numa distance
> > will get hard coded as LOCAL_DISTANCE for all nodes.  This causes
> > task scheduling anomaly since scheduler will skip building numa
> > level domain (topmost domain with all cpus) if all numa distances
> > are same.  (value of 'level' in sched_init_numa() will remain 0)
> > 
> > Prior to the above commit:
> > ((from) == (to) ? LOCAL_DISTANCE : REMOTE_DISTANCE)
> > 
> > Restoring compatible behavior with this patch for old powerpc systems
> > with device tree where numa distance are encoded as form0.
> > 
> > Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
> > Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> > ---
> >  arch/powerpc/mm/numa.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> What stable tree should this be applied to?

All of them please.

cheers

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

* Re: [PATCH] powerpc: fix numa distance for form0 device tree
  2013-05-07  3:49 [PATCH] powerpc: fix numa distance for form0 device tree Michael Ellerman
  2013-05-07  4:06 ` Greg KH
@ 2013-05-08 10:29 ` Luis Henriques
  2013-05-09  0:04   ` Michael Ellerman
  2013-05-10  4:45 ` Ben Hutchings
  2 siblings, 1 reply; 6+ messages in thread
From: Luis Henriques @ 2013-05-08 10:29 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Anton Blanchard, stable

On Tue, May 07, 2013 at 01:49:34PM +1000, Michael Ellerman wrote:
> From: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
> 
> Commit 7122beeee7bc1757682049780179d7c216dd1c83 upstream.

Thanks, I'm queuing it for the 3.5 kernel.

Cheers,
--
Luis

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

* Re: [PATCH] powerpc: fix numa distance for form0 device tree
  2013-05-08 10:29 ` Luis Henriques
@ 2013-05-09  0:04   ` Michael Ellerman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2013-05-09  0:04 UTC (permalink / raw)
  To: Luis Henriques; +Cc: linuxppc-dev, Anton Blanchard, stable

On Wed, 2013-05-08 at 11:29 +0100, Luis Henriques wrote:
> On Tue, May 07, 2013 at 01:49:34PM +1000, Michael Ellerman wrote:
> > From: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
> > 
> > Commit 7122beeee7bc1757682049780179d7c216dd1c83 upstream.
> 
> Thanks, I'm queuing it for the 3.5 kernel.

Thanks, I didn't know you guys were maintaining a 3.5 stable branch.

cheers

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

* Re: [PATCH] powerpc: fix numa distance for form0 device tree
  2013-05-07  3:49 [PATCH] powerpc: fix numa distance for form0 device tree Michael Ellerman
  2013-05-07  4:06 ` Greg KH
  2013-05-08 10:29 ` Luis Henriques
@ 2013-05-10  4:45 ` Ben Hutchings
  2 siblings, 0 replies; 6+ messages in thread
From: Ben Hutchings @ 2013-05-10  4:45 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Anton Blanchard, stable

[-- Attachment #1: Type: text/plain, Size: 325 bytes --]

On Tue, 2013-05-07 at 13:49 +1000, Michael Ellerman wrote:
> From: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
> 
> Commit 7122beeee7bc1757682049780179d7c216dd1c83 upstream.
[...]

Queued up for 3.2, thanks.

Ben.

-- 
Ben Hutchings
For every action, there is an equal and opposite criticism. - Harrison

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

end of thread, other threads:[~2013-05-10  5:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-07  3:49 [PATCH] powerpc: fix numa distance for form0 device tree Michael Ellerman
2013-05-07  4:06 ` Greg KH
2013-05-07  4:23   ` Michael Ellerman
2013-05-08 10:29 ` Luis Henriques
2013-05-09  0:04   ` Michael Ellerman
2013-05-10  4:45 ` Ben Hutchings

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.