Hi Mike,
(recipient list fixed up ...)
Am 12.05.2019 um 19:45 schrieb Michael Schmitz:
I can't say I really understand the reason for inability to use ST-RAM as
normal memory if the kernel was loaded into the FastRAM, maybe with
sprase
it would be easier to fix it.
As far as I remember, memory chunks had to be mapped in order of
increasing physical addresses with discontigmem. The first chunk is
always the one that the kernel resides in, violating this condition when
loading the kernel to the FastRAM chunk.
Sparsemem was mentioned as the solution to this problem when I last
looked at this. I need to look up the details, it's been a few years.
Just disabling the check for out-of-order memory chunks in mm/motorola.c
does produce a number of BUG()s:
BUG: Bad page state in process swapper pfn:00001
page:0fd58028 count:0 mapcount:1 mapping:00000000 index:0x0
flags: 0x0()
raw: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
raw: 00000000 00000000
page dumped because: nonzero mapcount
(60 in total - pfn 1 through 3c). Kernel boots through to login prompt.
Correction - only the first 60 pages get dumped. All of ST-RAM (14 MB)
is triggering the same condition, and consequently gets skipped.
Our paging_init() calculates availmem and min_low_pfn from data on the
first memory chunk, which isn't appropriate when we now try to map the
ST-RAM chunk as well. As far as I can see, availmem is only used
internal to the m68k mm code and won't need and different treatment.
min_low_pfn now probably needs to be calculated from the start address
of the lowest address memory chunk?
Cheers,
Michael
Cheers,
Michael
Haven't seen any evidence to the contrary, but I've not put the
system under
any kind of memory pressure.
With these caveats:
Tested-By: Michael Schmitz <schmitzmic@xxxxxxxxx>
Thanks!
Cheers,
Michael
The section size of 16M was chosen pretty much arbitrarily as I
couldn't
find specs for systems with e.g. Zorro memory extensions.
Mike Rapoport (3):
m68k/mm: make node data and node setup depend on CONFIG_DISCONTIGMEM
m68k/mm: enable use of generic memory_model.h for !DISCONTIGMEM
m68k/mm: switch from DISCONTIGMEM to SPARSEMEM
arch/m68k/Kconfig.cpu | 12 +++++--
arch/m68k/include/asm/page.h | 2 ++
arch/m68k/include/asm/page_mm.h | 6 +++-
arch/m68k/include/asm/sparsemem.h | 8 +++++
arch/m68k/include/asm/virtconvert.h | 2 +-
arch/m68k/mm/init.c | 8 ++---
arch/m68k/mm/motorola.c | 64
++++++++++++++++++++++++++++++-------
7 files changed, 83 insertions(+), 19 deletions(-)
create mode 100644 arch/m68k/include/asm/sparsemem.h