linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix: PowerNV crash with 4.4.0-rc8 at sched_init_numa
@ 2016-01-15 19:01 Raghavendra K T
  2016-01-18 11:06 ` Jan Stancek
  2016-01-19 13:38 ` [tip:sched/urgent] sched: Fix crash in sched_init_numa() tip-bot for Raghavendra K T
  0 siblings, 2 replies; 4+ messages in thread
From: Raghavendra K T @ 2016-01-15 19:01 UTC (permalink / raw)
  To: mingo, peterz, benh, paulus, mpe, anton, akpm
  Cc: jstancek, gkurz, grant.likely, nikunj, vdavydov, raghavendra.kt,
	linuxppc-dev, linux-kernel, linux-mm

Commit c118baf80256 ("arch/powerpc/mm/numa.c: do not allocate bootmem
memory for non existing nodes") avoided bootmem memory allocation for
non existent nodes.

When DEBUG_PER_CPU_MAPS enabled, powerNV system failed to boot because
in sched_init_numa, cpumask_or operation was done on unallocated nodes.
Fix that by making cpumask_or operation only on existing nodes.

[ Tested with and w/o DEBUG_PER_CPU_MAPS on x86 and powerpc ]

Reported-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 44253ad..474658b 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6840,7 +6840,7 @@ static void sched_init_numa(void)
 
 			sched_domains_numa_masks[i][j] = mask;
 
-			for (k = 0; k < nr_node_ids; k++) {
+			for_each_node(k) {
 				if (node_distance(j, k) > sched_domains_numa_distance[i])
 					continue;
 
-- 
1.7.11.7

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

* Re: [PATCH] Fix: PowerNV crash with 4.4.0-rc8 at sched_init_numa
  2016-01-15 19:01 [PATCH] Fix: PowerNV crash with 4.4.0-rc8 at sched_init_numa Raghavendra K T
@ 2016-01-18 11:06 ` Jan Stancek
  2016-01-19 13:38 ` [tip:sched/urgent] sched: Fix crash in sched_init_numa() tip-bot for Raghavendra K T
  1 sibling, 0 replies; 4+ messages in thread
From: Jan Stancek @ 2016-01-18 11:06 UTC (permalink / raw)
  To: Raghavendra K T
  Cc: mingo, peterz, benh, paulus, mpe, anton, akpm, gkurz,
	grant likely, nikunj, vdavydov, linuxppc-dev, linux-kernel,
	linux-mm





----- Original Message -----
> From: "Raghavendra K T" <raghavendra.kt@linux.vnet.ibm.com>
> To: mingo@redhat.com, peterz@infradead.org, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au,
> anton@samba.org, akpm@linux-foundation.org
> Cc: jstancek@redhat.com, gkurz@linux.vnet.ibm.com, "grant likely" <grant.likely@linaro.org>,
> nikunj@linux.vnet.ibm.com, vdavydov@parallels.com, "raghavendra kt" <raghavendra.kt@linux.vnet.ibm.com>,
> linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org
> Sent: Friday, 15 January, 2016 8:01:23 PM
> Subject: [PATCH] Fix: PowerNV crash with 4.4.0-rc8 at sched_init_numa
> 
> Commit c118baf80256 ("arch/powerpc/mm/numa.c: do not allocate bootmem
> memory for non existing nodes") avoided bootmem memory allocation for
> non existent nodes.
> 
> When DEBUG_PER_CPU_MAPS enabled, powerNV system failed to boot because
> in sched_init_numa, cpumask_or operation was done on unallocated nodes.
> Fix that by making cpumask_or operation only on existing nodes.
> 
> [ Tested with and w/o DEBUG_PER_CPU_MAPS on x86 and powerpc ]
> 
> Reported-by: Jan Stancek <jstancek@redhat.com>

Tested-by: Jan Stancek <jstancek@redhat.com>

I also verified with my setup, that this made the crash go away.
Report mail thread for reference:
  https://lists.ozlabs.org/pipermail/linuxppc-dev/2016-January/137691.html

Regards,
Jan

> Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
> ---
>  kernel/sched/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 44253ad..474658b 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -6840,7 +6840,7 @@ static void sched_init_numa(void)
>  
>  			sched_domains_numa_masks[i][j] = mask;
>  
> -			for (k = 0; k < nr_node_ids; k++) {
> +			for_each_node(k) {
>  				if (node_distance(j, k) > sched_domains_numa_distance[i])
>  					continue;
>  
> --
> 1.7.11.7
> 
> 

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

* [tip:sched/urgent] sched: Fix crash in sched_init_numa()
  2016-01-15 19:01 [PATCH] Fix: PowerNV crash with 4.4.0-rc8 at sched_init_numa Raghavendra K T
  2016-01-18 11:06 ` Jan Stancek
@ 2016-01-19 13:38 ` tip-bot for Raghavendra K T
  2016-02-08 11:38   ` Raghavendra K T
  1 sibling, 1 reply; 4+ messages in thread
From: tip-bot for Raghavendra K T @ 2016-01-19 13:38 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, gkurz, raghavendra.kt, vdavydov, mpe, linux-mm,
	linuxppc-dev, peterz, hpa, nikunj, tglx, mingo, paulus,
	grant.likely, jstancek, benh, anton

Commit-ID:  9c03ee147193645be4c186d3688232fa438c57c7
Gitweb:     http://git.kernel.org/tip/9c03ee147193645be4c186d3688232fa438c57c7
Author:     Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
AuthorDate: Sat, 16 Jan 2016 00:31:23 +0530
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 19 Jan 2016 08:42:20 +0100

sched: Fix crash in sched_init_numa()

The following PowerPC commit:

  c118baf80256 ("arch/powerpc/mm/numa.c: do not allocate bootmem memory for non existing nodes")

avoids allocating bootmem memory for non existent nodes.

But when DEBUG_PER_CPU_MAPS=y is enabled, my powerNV system failed to boot
because in sched_init_numa(), cpumask_or() operation was done on
unallocated nodes.

Fix that by making cpumask_or() operation only on existing nodes.

[ Tested with and w/o DEBUG_PER_CPU_MAPS=y on x86 and PowerPC. ]

Reported-by: Jan Stancek <jstancek@redhat.com>
Tested-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Cc: <gkurz@linux.vnet.ibm.com>
Cc: <grant.likely@linaro.org>
Cc: <nikunj@linux.vnet.ibm.com>
Cc: <vdavydov@parallels.com>
Cc: <linuxppc-dev@lists.ozlabs.org>
Cc: <linux-mm@kvack.org>
Cc: <peterz@infradead.org>
Cc: <benh@kernel.crashing.org>
Cc: <paulus@samba.org>
Cc: <mpe@ellerman.id.au>
Cc: <anton@samba.org>
Link: http://lkml.kernel.org/r/1452884483-11676-1-git-send-email-raghavendra.kt@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 44253ad..474658b 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6840,7 +6840,7 @@ static void sched_init_numa(void)
 
 			sched_domains_numa_masks[i][j] = mask;
 
-			for (k = 0; k < nr_node_ids; k++) {
+			for_each_node(k) {
 				if (node_distance(j, k) > sched_domains_numa_distance[i])
 					continue;
 

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

* Re: [tip:sched/urgent] sched: Fix crash in sched_init_numa()
  2016-01-19 13:38 ` [tip:sched/urgent] sched: Fix crash in sched_init_numa() tip-bot for Raghavendra K T
@ 2016-02-08 11:38   ` Raghavendra K T
  0 siblings, 0 replies; 4+ messages in thread
From: Raghavendra K T @ 2016-02-08 11:38 UTC (permalink / raw)
  To: tglx, mingo, linux-mm, mpe, hpa, nikunj, linuxppc-dev, peterz,
	vdavydov, gkurz, linux-kernel, raghavendra.kt, jstancek, benh,
	anton, grant.likely, paulus, Greg Kroah-Hartman, stable
  Cc: tip-bot for Raghavendra K T, linux-tip-commits

On 01/19/2016 07:08 PM, tip-bot for Raghavendra K T wrote:
> Commit-ID:  9c03ee147193645be4c186d3688232fa438c57c7
> Gitweb:     http://git.kernel.org/tip/9c03ee147193645be4c186d3688232fa438c57c7
> Author:     Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
> AuthorDate: Sat, 16 Jan 2016 00:31:23 +0530
> Committer:  Ingo Molnar <mingo@kernel.org>
> CommitDate: Tue, 19 Jan 2016 08:42:20 +0100
>
> sched: Fix crash in sched_init_numa()
>
> The following PowerPC commit:
>
>    c118baf80256 ("arch/powerpc/mm/numa.c: do not allocate bootmem memory for non existing nodes")
>
> avoids allocating bootmem memory for non existent nodes.
>
> But when DEBUG_PER_CPU_MAPS=y is enabled, my powerNV system failed to boot
> because in sched_init_numa(), cpumask_or() operation was done on
> unallocated nodes.
>
> Fix that by making cpumask_or() operation only on existing nodes.
>
> [ Tested with and w/o DEBUG_PER_CPU_MAPS=y on x86 and PowerPC. ]
>
> Reported-by: Jan Stancek <jstancek@redhat.com>
> Tested-by: Jan Stancek <jstancek@redhat.com>
> Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
> Cc: <gkurz@linux.vnet.ibm.com>
> Cc: <grant.likely@linaro.org>
> Cc: <nikunj@linux.vnet.ibm.com>
> Cc: <vdavydov@parallels.com>
> Cc: <linuxppc-dev@lists.ozlabs.org>
> Cc: <linux-mm@kvack.org>
> Cc: <peterz@infradead.org>
> Cc: <benh@kernel.crashing.org>
> Cc: <paulus@samba.org>
> Cc: <mpe@ellerman.id.au>
> Cc: <anton@samba.org>
> Link: http://lkml.kernel.org/r/1452884483-11676-1-git-send-email-raghavendra.kt@linux.vnet.ibm.com
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> ---
>   kernel/sched/core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 44253ad..474658b 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -6840,7 +6840,7 @@ static void sched_init_numa(void)
>
>   			sched_domains_numa_masks[i][j] = mask;
>
> -			for (k = 0; k < nr_node_ids; k++) {
> +			for_each_node(k) {
>   				if (node_distance(j, k) > sched_domains_numa_distance[i])
>   					continue;
>
>
>
>

Hello Greg,
Above commit fixes the debug kernel crash in 4.4 kernel [ when
DEBUG_PER_CPU_MAPS=y to be precise]. This is a regression in 4.4 from
4.3 and should be ideally present in 4.4-stable.

Could you please pull in this change.?

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

end of thread, other threads:[~2016-02-08 11:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-15 19:01 [PATCH] Fix: PowerNV crash with 4.4.0-rc8 at sched_init_numa Raghavendra K T
2016-01-18 11:06 ` Jan Stancek
2016-01-19 13:38 ` [tip:sched/urgent] sched: Fix crash in sched_init_numa() tip-bot for Raghavendra K T
2016-02-08 11:38   ` Raghavendra K T

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).