Hi Mike, On Tue, Jun 18, 2019 at 8:10 AM Mike Rapoport <rppt@xxxxxxxxxxxxx> wrote:
On Mon, Jun 17, 2019 at 10:00:32PM +0200, Geert Uytterhoeven wrote:On Thu, May 16, 2019 at 8:03 AM Mike Rapoport <rppt@xxxxxxxxxxxxx> wrote:These pacthes replace DISCONTIGMEM with SPARSEMEM on m68k for systems with !SINGLE_MEMORY_CHUNK set. With SPARSEMEM there is a single node for the entire physical memory and to cope with holes in the physical address space it is divided to sections of up to 16M. Each section has it's own memory map which size depends on actual populated memory. The section size of 16M was chosen pretty much arbitrarily as I couldn't find specs for systems with e.g. Zorro memory extensions.
Unfortunately it crashes on my Amiga, cfr. the logs below. Then I realized the "section size of 16M". My Amiga has a single block of 12 MiB of FastRAM at 0x07400000, which is not aligned to 16 MiB. (Yes, base address of motherboard RAM is 0x08000000 - ramsize ;-) I've tried: -#define MAX_PHYSMEM_BITS 32 -#define SECTION_SIZE_BITS 24 +#define MAX_PHYSMEM_BITS 30 +#define SECTION_SIZE_BITS 22 but that doesn't seem to make a difference. Do you have a clue? Thanks!Not really, at least yet. Can you please send the entire log with "mminit_loglevel=4 memblock=debug debug" in the command line?
Attached, with debug_boot_weak_hash added, which reveals it's a real NULL (=0x0) pointer dereference. Looking at the disassembly, it happens in clear_page(). Call chain: get_page_from_freelist() prep_new_page() clear_highpage() void *kaddr = kmap_atomic(page); clear_page(kaddr); get_page_from_freelist() verifies page is non-zero before calling prep_new_page(), so it must be the kmap_atomic() that returns NULL. kmap_atomic() basically does page_address(page). As m68k defines WANT_PAGE_VIRTUAL, that evaluates to page->virtual, which I assume to be NULL. Is there a call to set_page_address() missing in the sparsemem code? Questions: 1. Why does it work on Atari/ARAnyM? 2. Why does it work on SPARC64, which also uses WANT_PAGE_VIRTUAL and has SPARSEMEM support? (arc uses WANT_PAGE_VIRTUAL, but no SPARSEMEM) Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Attachment:
dmesg-5.2.0-rc5-amiga-nomod-01404-gf5057647889105fe.2
Description: Binary data