archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <>
To: Andrew Morton <>
Cc: Alexey Dobriyan <>,
	Catalin Marinas <>,
	Geert Uytterhoeven <>,
	Greg Ungerer <>,
	John Paul Adrian Glaubitz <>,
	Jonathan Corbet <>,
	Matt Turner <>, Meelis Roos <>,
	Michael Schmitz <>,
	Mike Rapoport <>,
	Mike Rapoport <>,
	Russell King <>,
	Tony Luck <>,
	Vineet Gupta <>, Will Deacon <>,,,,,,,,,
Subject: [PATCH 13/13] m68k: deprecate DISCONTIGMEM
Date: Tue, 27 Oct 2020 13:29:55 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

From: Mike Rapoport <>

DISCONTIGMEM was intended to provide more efficient support for systems
with holes in their physical address space that FLATMEM did.

Yet, it's overhead in terms of the memory consumption seems to overweight
the savings on the unused memory map.

For a ARAnyM system with 16 MBytes of FastRAM configured, the memory usage
reported after page allocator initialization is

Memory: 23828K/30720K available (3206K kernel code, 535K rwdata, 936K rodata, 768K init, 193K bss, 6892K reserved, 0K cma-reserved)

and with DISCONTIGMEM disabled and with relatively large hole in the memory
map it is:

Memory: 23864K/30720K available (3197K kernel code, 516K rwdata, 936K rodata, 764K init, 179K bss, 6856K reserved, 0K cma-reserved)

Moreover, since m68k already has custom pfn_valid() it is possible to
define HAVE_ARCH_PFN_VALID to enable freeing of unused memory map. The
minimal size of a hole that can be freed should not be less than
MAX_ORDER_NR_PAGES so to achieve more substantial memory savings let m68k
also define custom FORCE_MAX_ZONEORDER.

With FORCE_MAX_ZONEORDER set to 9 memory usage becomes:

Memory: 23880K/30720K available (3197K kernel code, 516K rwdata, 936K rodata, 764K init, 179K bss, 6840K reserved, 0K cma-reserved)

Signed-off-by: Mike Rapoport <>
 arch/m68k/Kconfig.cpu | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
index 3af0fca03803..763bc80a27aa 100644
--- a/arch/m68k/Kconfig.cpu
+++ b/arch/m68k/Kconfig.cpu
@@ -21,6 +21,7 @@ choice
 config M68KCLASSIC
 	bool "Classic M68K CPU family support"
 config COLDFIRE
 	bool "Coldfire CPU family support"
@@ -378,11 +379,34 @@ config SINGLE_MEMORY_CHUNK
 	  Ignore all but the first contiguous chunk of physical memory for VM
 	  purposes.  This will save a few bytes kernel size and may speed up
-	  some operations.  Say N if not sure.
+	  some operations.
+	  When this option os set to N, you may want to lower "Maximum zone
+	  order" to save memory that could be wasted for unused memory map.
+	  Say N if not sure.
+	depends on BROKEN
+	int "Maximum zone order" if ADVANCED
+	default "11"
+	help
+	  The kernel memory allocator divides physically contiguous memory
+	  blocks into "zones", where each zone is a power of two number of
+	  pages.  This option selects the largest power of two that the kernel
+	  keeps in the memory allocator.  If you need to allocate very large
+	  blocks of physically contiguous memory, then you may need to
+	  increase this value.
+	  For systems that have holes in their physical address space this
+	  value also defines the minimal size of the hole that allows
+	  freeing unused memory map.
+	  This config option is actually maximum order plus one. For example,
+	  a value of 11 means that the largest free memory block is 2^10 pages.
 config 060_WRITETHROUGH
 	bool "Use write-through caching for 68060 supervisor accesses"
 	depends on ADVANCED && M68060

      parent reply	other threads:[~2020-10-27 11:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 11:29 [PATCH 00/13] arch, mm: deprecate DISCONTIGMEM Mike Rapoport
2020-10-27 11:29 ` [PATCH 01/13] alpha: switch from DISCONTIGMEM to SPARSEMEM Mike Rapoport
2020-10-27 11:29 ` [PATCH 02/13] ia64: remove custom __early_pfn_to_nid() Mike Rapoport
2020-10-27 11:29 ` [PATCH 03/13] ia64: remove 'ifdef CONFIG_ZONE_DMA32' statements Mike Rapoport
2020-10-27 11:29 ` [PATCH 04/13] ia64: discontig: paging_init(): remove local max_pfn calculation Mike Rapoport
2020-10-27 11:29 ` [PATCH 05/13] ia64: split virtual map initialization out of paging_init() Mike Rapoport
2020-10-27 11:29 ` [PATCH 06/13] ia64: forbid using VIRTUAL_MEM_MAP with FLATMEM Mike Rapoport
2020-10-27 11:29 ` [PATCH 07/13] ia64: make SPARSEMEM default and disable DISCONTIGMEM Mike Rapoport
2020-12-12 16:01   ` Guenter Roeck
2020-12-13  8:36     ` Mike Rapoport
2020-10-27 11:29 ` [PATCH 08/13] arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL Mike Rapoport
2020-10-27 11:29 ` [PATCH 09/13] arm, arm64: move free_unused_memmap() to generic mm Mike Rapoport
2020-10-27 11:29 ` [PATCH 10/13] arc: use FLATMEM with freeing of unused memory map instead of DISCONTIGMEM Mike Rapoport
2020-10-27 11:29 ` [PATCH 11/13] m68k/mm: make node data and node setup depend on CONFIG_DISCONTIGMEM Mike Rapoport
2020-10-28  9:25   ` Geert Uytterhoeven
2020-10-28 11:16     ` Mike Rapoport
2020-10-28 18:14       ` Michael Schmitz
2020-10-28 18:57         ` Mike Rapoport
2020-11-01 16:55       ` Mike Rapoport
2020-10-27 11:29 ` [PATCH 12/13] m68k/mm: enable use of generic memory_model.h for !DISCONTIGMEM Mike Rapoport
2020-10-27 11:29 ` Mike Rapoport [this message]

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

* 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).