linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Schmitz <schmitzmic@gmail.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: linux-m68k@lists.linux-m68k.org,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Greg Ungerer <gerg@linux-m68k.org>,
	Andreas Schwab <schwab@linux-m68k.org>,
	Finn Thain <fthain@telegraphics.com.au>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	Mike Rapoport <rppt@linux.ibm.com>
Subject: Re: [PATCH v3 0/3] m68k/mm: switch from DISCONTIGMEM to SPARSEMEM
Date: Sat, 22 Aug 2020 11:27:18 +1200	[thread overview]
Message-ID: <9ea389e1-bd86-953b-8ae2-40278506e30a@gmail.com> (raw)
In-Reply-To: <20200821075636.GF752365@kernel.org>

Hi Mike,

only tested on ARAnyM, but appears to work (after adding sparsemem.h and 
changing memblocks_present() to non-static).

20 kB more total memory with sparsemem. Less memory used when booting to 
FastRAM, more used when booting to ST-RAM (checked right after boot on 
an idle system). The latter probably isn't significant.

Cheers,

	Michael


Am 21.08.2020 um 19:56 schrieb Mike Rapoport:
> On Fri, Aug 21, 2020 at 10:29:13AM +1200, Michael Schmitz wrote:
>> Hi Mike,
>>
>> Sorry, I had seen those but didn't get around to test in time.
>>
>> Applying your patch series to Geert's v5.9-rc1, I get this:
>>
>>>   CC      kernel/bounds.s
>>>   CC      arch/m68k/kernel/asm-offsets.s
>>> In file included from ./include/linux/mmzone.h:19,
>>>                  from ./include/linux/topology.h:33,
>>>                  from ./include/linux/irq.h:19,
>>>                  from ./include/asm-generic/hardirq.h:13,
>>>                  from ./arch/m68k/include/generated/asm/hardirq.h:1,
>>>                  from ./include/linux/hardirq.h:10,
>>>                  from ./include/linux/interrupt.h:11,
>>>                  from ./include/linux/kernel_stat.h:9,
>>>                  from arch/m68k/kernel/asm-offsets.c:16:
>>> ./include/linux/page-flags-layout.h:28:10: fatal error: asm/sparsemem.h:
>>> No such file or directory
>>>  #include <asm/sparsemem.h>
>>>           ^~~~~~~~~~~~~~~~~
>>> compilation terminated.
>>> make[2]: *** [arch/m68k/kernel/asm-offsets.s] Error 1
>>> make[1]: *** [prepare0] Error 2
>>> make: *** [__sub-make] Error 2
>>
>> Your patch announcement blurb hat sparsemem.h listed among the changed
>> files, but none of the three patches stats reference that file. Am I missing
>> a prerequisite here?
>
> Argh, I forgot to 'git add asm/sparsemem.h'.
> I'll resend a refreshed version in a couple of days.
>
>> Cheers,
>>
>>     Michael
>>
>>
>> On 21/08/20 4:03 AM, Mike Rapoport wrote:
>>> Gentle ping :)
>>>
>>> On Sat, Jul 18, 2020 at 07:26:48PM +0300, Mike Rapoport wrote:
>>>> From: Mike Rapoport <rppt@linux.ibm.com>
>>>>
>>>> Hi,
>>>>
>>>> It took me a while to get back to this, but better late than never :)
>>>>
>>>> These patches 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
>>>> several megabytes.
>>>>
>>>> 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.
>>>> Yet, we cannot use smaller sections and still be able to address the entire
>>>> 4G of the physical memory because the section number is encoded in the page
>>>> flags and there are only 8 bits available.
>>>>
>>>> For systems with several small memory chunks and with small (several megs)
>>>> holes between them, 16M section size would cause wasted parts in the memory
>>>> map and it is desirable to allow smaller section size at the expense of
>>>> limiting the addressable memory.
>>>>
>>>> I've hesitated between adding Kconfig option as Finn suggested [1] and
>>>> other options like SPARSE_VMEMMAP or ARCH_HAS_HOLES_MEMORYMODEL. In the
>>>> end, I think Kconfig is the simplest one from the implementation point of
>>>> view and would work fine for people that run mainline kernels on vintage
>>>> hardware.
>>>>
>>>> For the systems with ST-RAM and FastRAM, the switch to SPARSEMEM does not
>>>> change the limitation that if the kernel is loaded into the FastRam the
>>>> ST-RAM remains unmapped. It only ensures that if the kernel is loaded in
>>>> ST-RAM, the memory map is allocated from high physical addresses and then
>>>> atari/stram.c is able to reserve the frame buffer memory. If the kernel is
>>>> loaded to FastRAM, the ST-RAM remains unmapped as with DISCONTIGMEM and the
>>>> atari/stram.c maps it as IOMEM.
>>>>
>>>> [1] https://marc.info/?l=linux-m68k&m=156309170500921&w=2
>>>>
>>>> v3 changes:
>>>> * rebase on the current upstream
>>>> * alias ARCH_PFN_BASE to m68k_memory[0].addr
>>>> * add configuration option to allow two variants of section size.
>>>>
>>>> v2 changes:
>>>> * rebase on the current upstream
>>>> * make ColdFire MMU select SINGLE_MEMORY_CHUNK in Kconfig.cpu
>>>>
>>>> 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               | 14 ++++++--
>>>>   arch/m68k/include/asm/page.h        |  2 ++
>>>>   arch/m68k/include/asm/page_mm.h     |  6 +++-
>>>>   arch/m68k/include/asm/q.h   |  8 +++++
>>>>   arch/m68k/include/asm/virtconvert.h |  2 +-
>>>>   arch/m68k/mm/init.c                 |  8 ++---
>>>>   arch/m68k/mm/motorola.c             | 64 ++++++++++++++++++++++++++++++-------
>>>>   7 files changed, 84 insertions(+), 20 deletions(-)
>>>>   create mode 100644 arch/m68k/include/asm/sparsemem.h
>>>>
>>>> --
>>>> 2.7.4
>>>>
>>>>
>>>> *** BLURB HERE ***
>>>>
>>>> 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               | 23 ++++++++++++++---
>>>>   arch/m68k/include/asm/page.h        |  2 ++
>>>>   arch/m68k/include/asm/page_mm.h     |  7 +++++-
>>>>   arch/m68k/include/asm/virtconvert.h |  2 +-
>>>>   arch/m68k/mm/init.c                 |  8 +++---
>>>>   arch/m68k/mm/motorola.c             | 39 ++++++++++++++++++++++++++---
>>>>   6 files changed, 69 insertions(+), 12 deletions(-)
>>>>
>>>> --
>>>> 2.26.2
>>>>
>

  parent reply	other threads:[~2020-08-21 23:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-18 16:26 [PATCH v3 0/3] m68k/mm: switch from DISCONTIGMEM to SPARSEMEM Mike Rapoport
2020-07-18 16:26 ` [PATCH v3 1/3] m68k/mm: make node data and node setup depend on CONFIG_DISCONTIGMEM Mike Rapoport
2020-07-18 16:26 ` [PATCH v3 2/3] m68k/mm: enable use of generic memory_model.h for !DISCONTIGMEM Mike Rapoport
2020-07-18 16:26 ` [PATCH v3 3/3] m68k/mm: switch from DISCONTIGMEM to SPARSEMEM Mike Rapoport
2020-08-20 16:03 ` [PATCH v3 0/3] " Mike Rapoport
2020-08-20 22:29   ` Michael Schmitz
2020-08-21  7:56     ` Mike Rapoport
2020-08-21 20:58       ` Michael Schmitz
2020-08-21 23:27       ` Michael Schmitz [this message]
2020-08-22  9:51         ` Mike Rapoport
2020-08-22 19:16           ` Michael Schmitz
2020-08-23  8:06             ` Mike Rapoport
2020-08-24 20:47               ` Michael Schmitz
2020-08-25  5:42                 ` Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ea389e1-bd86-953b-8ae2-40278506e30a@gmail.com \
    --to=schmitzmic@gmail.com \
    --cc=fthain@telegraphics.com.au \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=rppt@kernel.org \
    --cc=rppt@linux.ibm.com \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).