diff mbox

[SRU,Utopic,1/1] sched/x86: Fix up typo in topology detection

Message ID 8fce2c60a0095fffdab12f2204eaa71b387882e3.1418231681.git.joseph.salisbury@canonical.com
State New
Headers show

Commit Message

Joseph Salisbury Dec. 10, 2014, 6:13 p.m. UTC
From: Dave Hansen <dave.hansen@linux.intel.com>

BugLink: http://bugs.launchpad.net/bugs/1386473

Commit:

  cebf15eb09a2 ("x86, sched: Add new topology for multi-NUMA-node CPUs")

some code to try to detect the situation where we have a NUMA node
inside of the "DIE" sched domain.

It detected this by looking for cpus which match_die() but do not match
NUMA nodes via topology_same_node().

I wrote it up as:

	if (match_die(c, o) == !topology_same_node(c, o))

which actually seemed to work some of the time, albiet
accidentally.

It should have been doing an &&, not an ==.

This code essentially chopped off the "DIE" domain on one of
Andrew Morton's systems.  He reported that this patch fixed his
issue.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Dave Hansen <dave@sr71.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Lan Tianyu <tianyu.lan@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Toshi Kani <toshi.kani@hp.com>
Link: http://lkml.kernel.org/r/20140930214546.FD481CFF@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 728e5653e6fdb2a0892e94a600aef8c9a036c7eb)

Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
---
 arch/x86/kernel/smpboot.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Brad Figg Dec. 10, 2014, 6:28 p.m. UTC | #1
On Wed, Dec 10, 2014 at 01:13:16PM -0500, Joseph Salisbury wrote:
> From: Dave Hansen <dave.hansen@linux.intel.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1386473
> 
> Commit:
> 
>   cebf15eb09a2 ("x86, sched: Add new topology for multi-NUMA-node CPUs")
> 
> some code to try to detect the situation where we have a NUMA node
> inside of the "DIE" sched domain.
> 
> It detected this by looking for cpus which match_die() but do not match
> NUMA nodes via topology_same_node().
> 
> I wrote it up as:
> 
> 	if (match_die(c, o) == !topology_same_node(c, o))
> 
> which actually seemed to work some of the time, albiet
> accidentally.
> 
> It should have been doing an &&, not an ==.
> 
> This code essentially chopped off the "DIE" domain on one of
> Andrew Morton's systems.  He reported that this patch fixed his
> issue.
> 
> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
> Reported-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Cc: Dave Hansen <dave@sr71.net>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Rientjes <rientjes@google.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Jan Kiszka <jan.kiszka@siemens.com>
> Cc: Lan Tianyu <tianyu.lan@intel.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Prarit Bhargava <prarit@redhat.com>
> Cc: Toshi Kani <toshi.kani@hp.com>
> Link: http://lkml.kernel.org/r/20140930214546.FD481CFF@viggo.jf.intel.com
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> (cherry picked from commit 728e5653e6fdb2a0892e94a600aef8c9a036c7eb)
> 
> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
> ---
>  arch/x86/kernel/smpboot.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index cf12440..c8748a1 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -449,7 +449,7 @@ void set_cpu_sibling_map(int cpu)
>  			} else if (i != cpu && !c->booted_cores)
>  				c->booted_cores = cpu_data(i).booted_cores;
>  		}
> -		if (match_die(c, o) == !topology_same_node(c, o))
> +		if (match_die(c, o) && !topology_same_node(c, o))
>  			primarily_use_numa_for_topology();
>  	}
>  }
> -- 
> 1.7.9.5
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Looks good.
Seth Forshee Dec. 10, 2014, 7:08 p.m. UTC | #2

Brad Figg Dec. 10, 2014, 7:23 p.m. UTC | #3
On Wed, Dec 10, 2014 at 01:13:16PM -0500, Joseph Salisbury wrote:
> From: Dave Hansen <dave.hansen@linux.intel.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1386473
> 
> Commit:
> 
>   cebf15eb09a2 ("x86, sched: Add new topology for multi-NUMA-node CPUs")
> 
> some code to try to detect the situation where we have a NUMA node
> inside of the "DIE" sched domain.
> 
> It detected this by looking for cpus which match_die() but do not match
> NUMA nodes via topology_same_node().
> 
> I wrote it up as:
> 
> 	if (match_die(c, o) == !topology_same_node(c, o))
> 
> which actually seemed to work some of the time, albiet
> accidentally.
> 
> It should have been doing an &&, not an ==.
> 
> This code essentially chopped off the "DIE" domain on one of
> Andrew Morton's systems.  He reported that this patch fixed his
> issue.
> 
> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
> Reported-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Cc: Dave Hansen <dave@sr71.net>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Rientjes <rientjes@google.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Jan Kiszka <jan.kiszka@siemens.com>
> Cc: Lan Tianyu <tianyu.lan@intel.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Prarit Bhargava <prarit@redhat.com>
> Cc: Toshi Kani <toshi.kani@hp.com>
> Link: http://lkml.kernel.org/r/20140930214546.FD481CFF@viggo.jf.intel.com
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> (cherry picked from commit 728e5653e6fdb2a0892e94a600aef8c9a036c7eb)
> 
> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
> ---
>  arch/x86/kernel/smpboot.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index cf12440..c8748a1 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -449,7 +449,7 @@ void set_cpu_sibling_map(int cpu)
>  			} else if (i != cpu && !c->booted_cores)
>  				c->booted_cores = cpu_data(i).booted_cores;
>  		}
> -		if (match_die(c, o) == !topology_same_node(c, o))
> +		if (match_die(c, o) && !topology_same_node(c, o))
>  			primarily_use_numa_for_topology();
>  	}
>  }
> -- 
> 1.7.9.5
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Somehow the first line of the commit text got dropped. I've added that back
and applied the commit to Utopic master-next
diff mbox

Patch

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index cf12440..c8748a1 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -449,7 +449,7 @@  void set_cpu_sibling_map(int cpu)
 			} else if (i != cpu && !c->booted_cores)
 				c->booted_cores = cpu_data(i).booted_cores;
 		}
-		if (match_die(c, o) == !topology_same_node(c, o))
+		if (match_die(c, o) && !topology_same_node(c, o))
 			primarily_use_numa_for_topology();
 	}
 }