Fragmented physical memory on powerpc/32

Christophe Leroy christophe.leroy at csgroup.eu
Tue Sep 13 22:36:13 AEST 2022



Le 13/09/2022 à 08:11, Christophe Leroy a écrit :
> 
> 
> Le 12/09/2022 à 23:16, Pali Rohár a écrit :
>>>
>>> My guess would be that something went wrong in the linear map setup, 
>>> but it
>>> won't hurt running with "memblock=debug" added to the kernel command 
>>> line
>>> to see if there is anything suspicious there.
>>
>> Here is boot log on serial console with memblock=debug command line:
>>
> ...
>>
>> Do you need something more for debug?
> 
> Can you send me the 'vmlinux' used to generate the above Oops so that I 
> can see exactly where we are in function mem_init().
> 
> And could you also try without CONFIG_HIGHMEM just in case.
> 

I looked at the vmlinux you sent me, the problem is in the loop for 
highmem in mem_init(). It crashes in the call to free_highmem_page()

#ifdef CONFIG_HIGHMEM
	{
		unsigned long pfn, highmem_mapnr;

		highmem_mapnr = lowmem_end_addr >> PAGE_SHIFT;
		for (pfn = highmem_mapnr; pfn < max_mapnr; ++pfn) {
			phys_addr_t paddr = (phys_addr_t)pfn << PAGE_SHIFT;
			struct page *page = pfn_to_page(pfn);
			if (!memblock_is_reserved(paddr))
				free_highmem_page(page);
		}
	}
#endif /* CONFIG_HIGHMEM */


As far as I can see in the memblock debug lines, the holes don't seem to 
be marked as reserved by memblock. So it is above valid ? Other 
architectures seem to do differently.

Can you try by replacing !memblock_is_reserved(paddr) by 
memblock_is_memory(paddr) ?

Thanks
Christophe


More information about the Linuxppc-dev mailing list