This seems to be breaking my powerpc pseries qemu boots.
The boot log with some extra debug shows eg:
$ make pseries_le_defconfig
$ qemu-system-ppc64 -nographic -vga none -M pseries -m 2G -kernel vmlinux
...
vmemmap_populate f000000000000000..f000000000004000, node 0
* f000000000000000..f000000001000000 allocated at c00000007e000000
hash__vmemmap_create_mapping: start 0xf000000000000000 size 0x1000000 phys 0x7e000000
vmemmap_populate f000000000000000..f000000000008000, node 0
* f000000000000000..f000000001000000 allocated at c00000007d000000
hash__vmemmap_create_mapping: start 0xf000000000000000 size 0x1000000 phys 0x7d000000
vmemmap_populate f000000000000000..f00000000000c000, node 0
* f000000000000000..f000000001000000 allocated at c00000007c000000
hash__vmemmap_create_mapping: start 0xf000000000000000 size 0x1000000 phys 0x7c000000
vmemmap_populate f000000000000000..f000000000010000, node 0
* f000000000000000..f000000001000000 allocated at c00000007b000000
hash__vmemmap_create_mapping: start 0xf000000000000000 size 0x1000000 phys 0x7b000000
vmemmap_populate f000000000000000..f000000000014000, node 0
* f000000000000000..f000000001000000 allocated at c00000007a000000
hash__vmemmap_create_mapping: start 0xf000000000000000 size 0x1000000 phys 0x7a000000
vmemmap_populate f000000000000000..f000000000018000, node 0
* f000000000000000..f000000001000000 allocated at c000000079000000
hash__vmemmap_create_mapping: start 0xf000000000000000 size 0x1000000 phys 0x79000000
vmemmap_populate f000000000000000..f00000000001c000, node 0
* f000000000000000..f000000001000000 allocated at c000000078000000
hash__vmemmap_create_mapping: start 0xf000000000000000 size 0x1000000 phys 0x78000000
vmemmap_populate f000000000000000..f000000000020000, node 0
* f000000000000000..f000000001000000 allocated at c000000077000000
hash__vmemmap_create_mapping: start 0xf000000000000000 size 0x1000000 phys 0x77000000
vmemmap_populate f000000000000000..f000000000024000, node 0
* f000000000000000..f000000001000000 allocated at c000000076000000
hash__vmemmap_create_mapping: start 0xf000000000000000 size 0x1000000 phys 0x76000000
hash__vmemmap_create_mapping: failed -1
<repeated many times>
Then there's lots of other warnings about bad page states and eventually
a NULL deref and we panic().
The problem seems to be that we're calling down into
hash__vmemmap_create_mapping() for every call to vmemmap_populate(),
whereas previously we would only call hash__vmemmap_create_mapping()
once because our vmemmap_populated() would return true.
There's actually a comment in sparse_init() that says:
* powerpc need to call sparse_init_one_section right after each
* sparse_early_mem_map_alloc, so allocate usemap_map at first.
So changing that behaviour does seem to be the problem.
I assume that comment is talking about the fact that we use pfn_valid()
in vmemmap_populated().
I'm not clear on how to fix it though.
Any ideas?
cheers
This seems to be breaking my powerpc pseries qemu boots.
The boot log with some extra debug shows eg:
$ make pseries_le_defconfig
$ qemu-system-ppc64 -nographic -vga none -M pseries -m 2G -kernel vmlinux
vmemmap_populate f000000000000000..f000000000024000, node 0
* f000000000000000..f000000001000000 allocated at c000000076000000
hash__vmemmap_create_mapping: start 0xf000000000000000 size 0x1000000 phys 0x76000000
hash__vmemmap_create_mapping: failed -1
<repeated many times>
Then there's lots of other warnings about bad page states and eventually
a NULL deref and we panic().
The problem seems to be that we're calling down into
hash__vmemmap_create_mapping() for every call to vmemmap_populate(),
whereas previously we would only call hash__vmemmap_create_mapping()
once because our vmemmap_populated() would return true.
There's actually a comment in sparse_init() that says:
* powerpc need to call sparse_init_one_section right after each
* sparse_early_mem_map_alloc, so allocate usemap_map at first.
So changing that behaviour does seem to be the problem.
I assume that comment is talking about the fact that we use pfn_valid()
in vmemmap_populated().
I'm not clear on how to fix it though.
Have you tried reverting that patch and building kernel to test again?
Does it work?
From: Pavel Tatashin <hidden> Date: 2018-07-11 13:55:59
I am OK, if this patch is removed from Baoquan's series. But, I would
still like to get rid of CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER, I
can work on this in my sparse_init re-write series. ppc64 should
really fallback safely to small chunks allocs, and if it does not
there is some existing bug. Michael please send the config that you
used.
Thank you,
Pavel
On Wed, Jul 11, 2018 at 9:37 AM Oscar Salvador
[off-list ref] wrote:
On Wed, Jul 11, 2018 at 10:49:58PM +1000, Michael Ellerman wrote:
This seems to be breaking my powerpc pseries qemu boots.
The boot log with some extra debug shows eg:
$ make pseries_le_defconfig
Could you please share the config?
I was not able to find such config in the kernel tree.
(top-posting repaired so I can reply to your email, add other people
and not confuse the heck out of them. Please don't)
I am OK, if this patch is removed from Baoquan's series. But, I would
still like to get rid of CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER, I
can work on this in my sparse_init re-write series. ppc64 should
really fallback safely to small chunks allocs, and if it does not
there is some existing bug. Michael please send the config that you
used.
OK, I shall drop
mm-sparse-remove-config_sparsemem_alloc_mem_map_together.patch for now.