From: Stephen Rothwell <hidden> Date: 2019-01-31 05:39:02
Hi all,
[I am guessing that is is something in Andrew's tree that has caused
this.]
My qemu boot of the powerpc pseries_le_defconfig config failed like this:
htab_hash_mask = 0x1ffff
-----------------------------------------------------
numa: NODE_DATA [mem 0x7ffe7000-0x7ffebfff]
Kernel panic - not syncing: sparse_buffer_init: Failed to allocate 2147483648 bytes align=0x10000 nid=0 from=fffffffffffffff
CPU: 0 PID: 0 Comm: swapper Not tainted 5.0.0-rc4 #2
Call Trace:
[c00000000105bbd0] [c000000000b1345c] dump_stack+0xb0/0xf4 (unreliable)
[c00000000105bc10] [c000000000111120] panic+0x168/0x3b8
[c00000000105bcb0] [c000000000e701c8] sparse_init_nid+0x178/0x550
[c00000000105bd70] [c000000000e709b4] sparse_init+0x210/0x238
[c00000000105bdb0] [c000000000e468f4] initmem_init+0x1e0/0x260
[c00000000105be80] [c000000000e3b9b0] setup_arch+0x354/0x3d4
[c00000000105bef0] [c000000000e33afc] start_kernel+0x98/0x648
[c00000000105bf90] [c00000000000b270] start_here_common+0x1c/0x52c
--
Cheers,
Stephen Rothwell
From: Stephen Rothwell <hidden> Date: 2019-01-31 06:06:35
Hi all,
On Thu, 31 Jan 2019 16:38:54 +1100 Stephen Rothwell [off-list ref] wrote:
[I am guessing that is is something in Andrew's tree that has caused
this.]
My qemu boot of the powerpc pseries_le_defconfig config failed like this:
htab_hash_mask = 0x1ffff
-----------------------------------------------------
numa: NODE_DATA [mem 0x7ffe7000-0x7ffebfff]
Kernel panic - not syncing: sparse_buffer_init: Failed to allocate 2147483648 bytes align=0x10000 nid=0 from=fffffffffffffff
CPU: 0 PID: 0 Comm: swapper Not tainted 5.0.0-rc4 #2
Call Trace:
[c00000000105bbd0] [c000000000b1345c] dump_stack+0xb0/0xf4 (unreliable)
[c00000000105bc10] [c000000000111120] panic+0x168/0x3b8
[c00000000105bcb0] [c000000000e701c8] sparse_init_nid+0x178/0x550
[c00000000105bd70] [c000000000e709b4] sparse_init+0x210/0x238
[c00000000105bdb0] [c000000000e468f4] initmem_init+0x1e0/0x260
[c00000000105be80] [c000000000e3b9b0] setup_arch+0x354/0x3d4
[c00000000105bef0] [c000000000e33afc] start_kernel+0x98/0x648
[c00000000105bf90] [c00000000000b270] start_here_common+0x1c/0x52c
A quick bisect leads to this:
1c3c9328cde027eb875ba4692f0a5d66b0afe862 is the first bad commit
commit 1c3c9328cde027eb875ba4692f0a5d66b0afe862
Author: Mike Rapoport [off-list ref]
Date: Thu Jan 31 10:51:32 2019 +1100
treewide: add checks for the return value of memblock_alloc*()
Add check for the return value of memblock_alloc*() functions and call
panic() in case of error. The panic message repeats the one used by
panicing memblock allocators with adjustment of parameters to include only
relevant ones.
The replacement was mostly automated with semantic patches like the one
below with manual massaging of format strings.
@@
expression ptr, size, align;
@@
ptr = memblock_alloc(size, align);
+ if (!ptr)
+ panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__,
size, align);
Link: http://lkml.kernel.org/r/1548057848-15136-20-git-send-email-rppt@linux.ibm.com
Signed-off-by: Mike Rapoport [off-list ref]
Reviewed-by: Guo Ren [off-list ref] [c-sky]
Acked-by: Paul Burton [off-list ref] [MIPS]
Acked-by: Heiko Carstens [off-list ref] [s390]
Reviewed-by: Juergen Gross [off-list ref] [Xen]
Reviewed-by: Geert Uytterhoeven [off-list ref] [m68k]
Cc: Catalin Marinas [off-list ref]
Cc: Christophe Leroy [off-list ref]
Cc: Christoph Hellwig [off-list ref]
Cc: "David S. Miller" [off-list ref]
Cc: Dennis Zhou [off-list ref]
Cc: Greentime Hu [off-list ref]
Cc: Greg Kroah-Hartman [off-list ref]
Cc: Guan Xuetao [off-list ref]
Cc: Guo Ren [off-list ref]
Cc: Mark Salter [off-list ref]
Cc: Matt Turner [off-list ref]
Cc: Max Filippov [off-list ref]
Cc: Michael Ellerman [off-list ref]
Cc: Michal Simek [off-list ref]
Cc: Petr Mladek [off-list ref]
Cc: Richard Weinberger [off-list ref]
Cc: Rich Felker [off-list ref]
Cc: Rob Herring [off-list ref]
Cc: Rob Herring [off-list ref]
Cc: Russell King [off-list ref]
Cc: Stafford Horne [off-list ref]
Cc: Tony Luck [off-list ref]
Cc: Vineet Gupta [off-list ref]
Cc: Yoshinori Sato [off-list ref]
Signed-off-by: Andrew Morton [off-list ref]
Which is just adding the panic we hit. So, presumably, the bug is in a
preceding patch :-(
I have left the kernel not booting for today.
--
Cheers,
Stephen Rothwell
Hi all,
On Thu, 31 Jan 2019 16:38:54 +1100 Stephen Rothwell [off-list ref] wrote:
quoted
[I am guessing that is is something in Andrew's tree that has caused
this.]
My qemu boot of the powerpc pseries_le_defconfig config failed like this:
htab_hash_mask = 0x1ffff
-----------------------------------------------------
numa: NODE_DATA [mem 0x7ffe7000-0x7ffebfff]
Kernel panic - not syncing: sparse_buffer_init: Failed to allocate 2147483648 bytes align=0x10000 nid=0 from=fffffffffffffff
CPU: 0 PID: 0 Comm: swapper Not tainted 5.0.0-rc4 #2
Call Trace:
[c00000000105bbd0] [c000000000b1345c] dump_stack+0xb0/0xf4 (unreliable)
[c00000000105bc10] [c000000000111120] panic+0x168/0x3b8
[c00000000105bcb0] [c000000000e701c8] sparse_init_nid+0x178/0x550
[c00000000105bd70] [c000000000e709b4] sparse_init+0x210/0x238
[c00000000105bdb0] [c000000000e468f4] initmem_init+0x1e0/0x260
[c00000000105be80] [c000000000e3b9b0] setup_arch+0x354/0x3d4
[c00000000105bef0] [c000000000e33afc] start_kernel+0x98/0x648
[c00000000105bf90] [c00000000000b270] start_here_common+0x1c/0x52c
A quick bisect leads to this:
1c3c9328cde027eb875ba4692f0a5d66b0afe862 is the first bad commit
commit 1c3c9328cde027eb875ba4692f0a5d66b0afe862
Author: Mike Rapoport [off-list ref]
Date: Thu Jan 31 10:51:32 2019 +1100
treewide: add checks for the return value of memblock_alloc*()
Add check for the return value of memblock_alloc*() functions and call
panic() in case of error. The panic message repeats the one used by
panicing memblock allocators with adjustment of parameters to include only
relevant ones.
The replacement was mostly automated with semantic patches like the one
below with manual massaging of format strings.
@@
expression ptr, size, align;
@@
ptr = memblock_alloc(size, align);
+ if (!ptr)
+ panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__,
size, align);
Link: http://lkml.kernel.org/r/1548057848-15136-20-git-send-email-rppt@linux.ibm.com
Signed-off-by: Mike Rapoport [off-list ref]
Reviewed-by: Guo Ren [off-list ref] [c-sky]
Acked-by: Paul Burton [off-list ref] [MIPS]
Acked-by: Heiko Carstens [off-list ref] [s390]
Reviewed-by: Juergen Gross [off-list ref] [Xen]
Reviewed-by: Geert Uytterhoeven [off-list ref] [m68k]
Cc: Catalin Marinas [off-list ref]
Cc: Christophe Leroy [off-list ref]
Cc: Christoph Hellwig [off-list ref]
Cc: "David S. Miller" [off-list ref]
Cc: Dennis Zhou [off-list ref]
Cc: Greentime Hu [off-list ref]
Cc: Greg Kroah-Hartman [off-list ref]
Cc: Guan Xuetao [off-list ref]
Cc: Guo Ren [off-list ref]
Cc: Mark Salter [off-list ref]
Cc: Matt Turner [off-list ref]
Cc: Max Filippov [off-list ref]
Cc: Michael Ellerman [off-list ref]
Cc: Michal Simek [off-list ref]
Cc: Petr Mladek [off-list ref]
Cc: Richard Weinberger [off-list ref]
Cc: Rich Felker [off-list ref]
Cc: Rob Herring [off-list ref]
Cc: Rob Herring [off-list ref]
Cc: Russell King [off-list ref]
Cc: Stafford Horne [off-list ref]
Cc: Tony Luck [off-list ref]
Cc: Vineet Gupta [off-list ref]
Cc: Yoshinori Sato [off-list ref]
Signed-off-by: Andrew Morton [off-list ref]
Which is just adding the panic we hit. So, presumably, the bug is in a
preceding patch :-(
I have left the kernel not booting for today.
No I think the error is really in that patch, see my other mail.
See https://elixir.bootlin.com/linux/v5.0-rc4/source/mm/memblock.c#L1455, memblock_alloc_try_nid_raw() is not supposed to panic, so the last hunk of this patch should be reverted.
Found in total three problematic hunks in that patch:
From: Mike Rapoport <hidden> Date: 2019-01-31 06:39:42
On Thu, Jan 31, 2019 at 07:15:26AM +0100, Christophe Leroy wrote:
Le 31/01/2019 à 07:06, Stephen Rothwell a écrit :
quoted
Hi all,
On Thu, 31 Jan 2019 16:38:54 +1100 Stephen Rothwell [off-list ref] wrote:
quoted
[I am guessing that is is something in Andrew's tree that has caused
this.]
My qemu boot of the powerpc pseries_le_defconfig config failed like this:
htab_hash_mask = 0x1ffff
-----------------------------------------------------
numa: NODE_DATA [mem 0x7ffe7000-0x7ffebfff]
Kernel panic - not syncing: sparse_buffer_init: Failed to allocate 2147483648 bytes align=0x10000 nid=0 from=fffffffffffffff
This means that sparse_buffer_init tries to allocate 2G for the sparsemap_buf...
Stephen, how many memory do you give to your VM?
A quick bisect leads to this:
1c3c9328cde027eb875ba4692f0a5d66b0afe862 is the first bad commit
commit 1c3c9328cde027eb875ba4692f0a5d66b0afe862
Author: Mike Rapoport [off-list ref]
Date: Thu Jan 31 10:51:32 2019 +1100
treewide: add checks for the return value of memblock_alloc*()
Add check for the return value of memblock_alloc*() functions and call
panic() in case of error. The panic message repeats the one used by
panicing memblock allocators with adjustment of parameters to include only
relevant ones.
The replacement was mostly automated with semantic patches like the one
below with manual massaging of format strings.
@@
expression ptr, size, align;
@@
ptr = memblock_alloc(size, align);
+ if (!ptr)
+ panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__,
size, align);
Link: http://lkml.kernel.org/r/1548057848-15136-20-git-send-email-rppt@linux.ibm.com
Signed-off-by: Mike Rapoport [off-list ref]
Reviewed-by: Guo Ren [off-list ref] [c-sky]
Acked-by: Paul Burton [off-list ref] [MIPS]
Acked-by: Heiko Carstens [off-list ref] [s390]
Reviewed-by: Juergen Gross [off-list ref] [Xen]
Reviewed-by: Geert Uytterhoeven [off-list ref] [m68k]
Cc: Catalin Marinas [off-list ref]
Cc: Christophe Leroy [off-list ref]
Cc: Christoph Hellwig [off-list ref]
Cc: "David S. Miller" [off-list ref]
Cc: Dennis Zhou [off-list ref]
Cc: Greentime Hu [off-list ref]
Cc: Greg Kroah-Hartman [off-list ref]
Cc: Guan Xuetao [off-list ref]
Cc: Guo Ren [off-list ref]
Cc: Mark Salter [off-list ref]
Cc: Matt Turner [off-list ref]
Cc: Max Filippov [off-list ref]
Cc: Michael Ellerman [off-list ref]
Cc: Michal Simek [off-list ref]
Cc: Petr Mladek [off-list ref]
Cc: Richard Weinberger [off-list ref]
Cc: Rich Felker [off-list ref]
Cc: Rob Herring [off-list ref]
Cc: Rob Herring [off-list ref]
Cc: Russell King [off-list ref]
Cc: Stafford Horne [off-list ref]
Cc: Tony Luck [off-list ref]
Cc: Vineet Gupta [off-list ref]
Cc: Yoshinori Sato [off-list ref]
Signed-off-by: Andrew Morton [off-list ref]
Which is just adding the panic we hit. So, presumably, the bug is in a
preceding patch :-(
I have left the kernel not booting for today.
From: Mike Rapoport <hidden> Date: 2019-01-31 07:40:32
(added Andrey Konovalov)
On Thu, Jan 31, 2019 at 07:15:26AM +0100, Christophe Leroy wrote:
quoted hunk
Le 31/01/2019 à 07:06, Stephen Rothwell a écrit :
quoted
Hi all,
On Thu, 31 Jan 2019 16:38:54 +1100 Stephen Rothwell [off-list ref] wrote:
quoted
[I am guessing that is is something in Andrew's tree that has caused
this.]
My qemu boot of the powerpc pseries_le_defconfig config failed like this:
htab_hash_mask = 0x1ffff
-----------------------------------------------------
numa: NODE_DATA [mem 0x7ffe7000-0x7ffebfff]
Kernel panic - not syncing: sparse_buffer_init: Failed to allocate 2147483648 bytes align=0x10000 nid=0 from=fffffffffffffff
CPU: 0 PID: 0 Comm: swapper Not tainted 5.0.0-rc4 #2
Call Trace:
[c00000000105bbd0] [c000000000b1345c] dump_stack+0xb0/0xf4 (unreliable)
[c00000000105bc10] [c000000000111120] panic+0x168/0x3b8
[c00000000105bcb0] [c000000000e701c8] sparse_init_nid+0x178/0x550
[c00000000105bd70] [c000000000e709b4] sparse_init+0x210/0x238
[c00000000105bdb0] [c000000000e468f4] initmem_init+0x1e0/0x260
[c00000000105be80] [c000000000e3b9b0] setup_arch+0x354/0x3d4
[c00000000105bef0] [c000000000e33afc] start_kernel+0x98/0x648
[c00000000105bf90] [c00000000000b270] start_here_common+0x1c/0x52c
A quick bisect leads to this:
1c3c9328cde027eb875ba4692f0a5d66b0afe862 is the first bad commit
commit 1c3c9328cde027eb875ba4692f0a5d66b0afe862
Author: Mike Rapoport [off-list ref]
Date: Thu Jan 31 10:51:32 2019 +1100
treewide: add checks for the return value of memblock_alloc*()
Add check for the return value of memblock_alloc*() functions and call
panic() in case of error. The panic message repeats the one used by
panicing memblock allocators with adjustment of parameters to include only
relevant ones.
Which is just adding the panic we hit. So, presumably, the bug is in a
preceding patch :-(
I have left the kernel not booting for today.
No I think the error is really in that patch, see my other mail.
See https://elixir.bootlin.com/linux/v5.0-rc4/source/mm/memblock.c#L1455,
memblock_alloc_try_nid_raw() is not supposed to panic, so the last hunk of
this patch should be reverted.
Found in total three problematic hunks in that patch:
I've looked more closely to the code that uses this function and it does
not seem to handle allocation error.
I can replace the panic with WARN(), but I think that panic() here is
appropriate.
Andrey, can you comment?
This one is actually fixes my own mistake from one of the previous patches
that converted memblock_alloc_base() to memblock_alloc_try_nid_raw() without
adding the panic() (commit 47e382eb08cfa0199c4ea9f9cc73f1b48a3a4b1d
"powerpc: prefer memblock APIs returning virtual address")
quoted hunk
@@ -425,6 +436,10 @@ static void __init sparse_buffer_init(unsigned long
This hunk was not needed as sparse can deal with this allocation failure.
Andrew, can you please add the below patch to as a fixup to "treewide: add
checks for the return value of memblock_alloc*()"?
From 854f54b9d4fe52f477765b905a4b2c421d30f46e Mon Sep 17 00:00:00 2001
From: Mike Rapoport <redacted>
Date: Thu, 31 Jan 2019 09:18:50 +0200
Subject: [PATCH] mm/sparse: don't panic if the allocation in
sparse_buffer_init fails
Addition of panic if memblock_alloc_try_nid_raw() call in
sparse_buffer_init() fails was over enthusiastic as the system is perfectly
capable to deal with that allocation failure.
Remove the panic().
Signed-off-by: Mike Rapoport <redacted>
---
mm/sparse.c | 4 ----
1 file changed, 4 deletions(-)
From: Stephen Rothwell <hidden> Date: 2019-01-31 08:35:44
Hi Mike,
On Thu, 31 Jan 2019 09:40:18 +0200 Mike Rapoport [off-list ref] wrote:
Andrew, can you please add the below patch to as a fixup to "treewide: add
checks for the return value of memblock_alloc*()"?
I have added that to linux-next for tomorrow (in case Andrew doesn't
get to it).
From 854f54b9d4fe52f477765b905a4b2c421d30f46e Mon Sep 17 00:00:00 2001
From: Mike Rapoport <redacted>
Date: Thu, 31 Jan 2019 09:18:50 +0200
Subject: [PATCH] mm/sparse: don't panic if the allocation in
sparse_buffer_init fails
Thanks all for the quick resolution.
--
Cheers,
Stephen Rothwell
On Thu, Jan 31, 2019 at 8:40 AM Mike Rapoport [off-list ref] wrote:
(added Andrey Konovalov)
On Thu, Jan 31, 2019 at 07:15:26AM +0100, Christophe Leroy wrote:
quoted
Le 31/01/2019 à 07:06, Stephen Rothwell a écrit :
quoted
Hi all,
On Thu, 31 Jan 2019 16:38:54 +1100 Stephen Rothwell [off-list ref] wrote:
quoted
[I am guessing that is is something in Andrew's tree that has caused
this.]
My qemu boot of the powerpc pseries_le_defconfig config failed like this:
htab_hash_mask = 0x1ffff
-----------------------------------------------------
numa: NODE_DATA [mem 0x7ffe7000-0x7ffebfff]
Kernel panic - not syncing: sparse_buffer_init: Failed to allocate 2147483648 bytes align=0x10000 nid=0 from=fffffffffffffff
CPU: 0 PID: 0 Comm: swapper Not tainted 5.0.0-rc4 #2
Call Trace:
[c00000000105bbd0] [c000000000b1345c] dump_stack+0xb0/0xf4 (unreliable)
[c00000000105bc10] [c000000000111120] panic+0x168/0x3b8
[c00000000105bcb0] [c000000000e701c8] sparse_init_nid+0x178/0x550
[c00000000105bd70] [c000000000e709b4] sparse_init+0x210/0x238
[c00000000105bdb0] [c000000000e468f4] initmem_init+0x1e0/0x260
[c00000000105be80] [c000000000e3b9b0] setup_arch+0x354/0x3d4
[c00000000105bef0] [c000000000e33afc] start_kernel+0x98/0x648
[c00000000105bf90] [c00000000000b270] start_here_common+0x1c/0x52c
A quick bisect leads to this:
1c3c9328cde027eb875ba4692f0a5d66b0afe862 is the first bad commit
commit 1c3c9328cde027eb875ba4692f0a5d66b0afe862
Author: Mike Rapoport [off-list ref]
Date: Thu Jan 31 10:51:32 2019 +1100
treewide: add checks for the return value of memblock_alloc*()
Add check for the return value of memblock_alloc*() functions and call
panic() in case of error. The panic message repeats the one used by
panicing memblock allocators with adjustment of parameters to include only
relevant ones.
Which is just adding the panic we hit. So, presumably, the bug is in a
preceding patch :-(
I have left the kernel not booting for today.
No I think the error is really in that patch, see my other mail.
See https://elixir.bootlin.com/linux/v5.0-rc4/source/mm/memblock.c#L1455,
memblock_alloc_try_nid_raw() is not supposed to panic, so the last hunk of
this patch should be reverted.
Found in total three problematic hunks in that patch:
I've looked more closely to the code that uses this function and it does
not seem to handle allocation error.
I can replace the panic with WARN(), but I think that panic() here is
appropriate.
Andrey, can you comment?
+ Andrey Ryabinin
I think panic() there looks appropriate. Added Andrey Ryabinin to take a look.
This one is actually fixes my own mistake from one of the previous patches
that converted memblock_alloc_base() to memblock_alloc_try_nid_raw() without
adding the panic() (commit 47e382eb08cfa0199c4ea9f9cc73f1b48a3a4b1d
"powerpc: prefer memblock APIs returning virtual address")
quoted
@@ -425,6 +436,10 @@ static void __init sparse_buffer_init(unsigned long
This hunk was not needed as sparse can deal with this allocation failure.
Andrew, can you please add the below patch to as a fixup to "treewide: add
checks for the return value of memblock_alloc*()"?
From 854f54b9d4fe52f477765b905a4b2c421d30f46e Mon Sep 17 00:00:00 2001
From: Mike Rapoport <redacted>
Date: Thu, 31 Jan 2019 09:18:50 +0200
Subject: [PATCH] mm/sparse: don't panic if the allocation in
sparse_buffer_init fails
Addition of panic if memblock_alloc_try_nid_raw() call in
sparse_buffer_init() fails was over enthusiastic as the system is perfectly
capable to deal with that allocation failure.
Remove the panic().
Signed-off-by: Mike Rapoport <redacted>
---
mm/sparse.c | 4 ----
1 file changed, 4 deletions(-)