mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Scott Branden <scott.branden@broadcom.com>
To: Arnd Bergmann <arnd@arndb.de>, Olof Johansson <olof@lixom.net>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>
Cc: BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Scott Branden <scott.branden@broadcom.com>
Subject: [PATCH 1/1] arm64: mm: add config options for page table configuration
Date: Wed,  7 Dec 2016 11:40:00 -0800	[thread overview]
Message-ID: <1481139600-24455-2-git-send-email-scott.branden@broadcom.com> (raw)
In-Reply-To: <1481139600-24455-1-git-send-email-scott.branden@broadcom.com>

Make MAX_PHYSMEM_BITS and SECTIONS_SIZE_BITS configurable by adding
config options.
Default to current settings currently defined in sparesmem.h.
For systems wishing to save memory the config options can be overridden.
Example, changing MAX_PHYSMEM_BITS from 48 to 36 at the same time as
changing SECTION_SIZE_BITS from 30 to 26 frees 13MB of memory.

Signed-off-by: Scott Branden <scott.branden@broadcom.com>
---
 arch/arm64/Kconfig                 | 21 +++++++++++++++++++++
 arch/arm64/include/asm/sparsemem.h |  4 ++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 2482fdd..d0a95de 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -121,6 +121,27 @@ config ARCH_PHYS_ADDR_T_64BIT
 config MMU
 	def_bool y
 
+config MAX_PHYSMEM_BITS
+	int "Maximum Physical Addressable Bits"
+	depends on SPARSEMEM
+	default 48
+	help
+	  Maximum number of physical addressable bits.
+	  If not all the physical bits are used this number can be reduced
+	  to save memory when creating page tables.
+
+	  If unsure, leave this at the default.
+
+config SECTION_SIZE_BITS
+	int "Section Size Bits"
+	depends on SPARSEMEM
+	default 30
+	help
+	  Size of each memory section.
+	  If you need to be able to allocate smaller
+	  sections in page table this number can be change to save memory.
+
+	  If unsure, leave this at the default.
 config DEBUG_RODATA
 	def_bool y
 
diff --git a/arch/arm64/include/asm/sparsemem.h b/arch/arm64/include/asm/sparsemem.h
index 74a9d30..6677582 100644
--- a/arch/arm64/include/asm/sparsemem.h
+++ b/arch/arm64/include/asm/sparsemem.h
@@ -17,8 +17,8 @@
 #define __ASM_SPARSEMEM_H
 
 #ifdef CONFIG_SPARSEMEM
-#define MAX_PHYSMEM_BITS	48
-#define SECTION_SIZE_BITS	30
+#define MAX_PHYSMEM_BITS	CONFIG_MAX_PHYSMEM_BITS
+#define SECTION_SIZE_BITS	CONFIG_SECTION_SIZE_BITS
 #endif
 
 #endif
-- 
2.5.0

  reply	other threads:[~2016-12-07 19:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 19:39 [PATCH 0/1] " Scott Branden
2016-12-07 19:40 ` Scott Branden [this message]
2016-12-08 10:00   ` [PATCH 1/1] " Catalin Marinas
2016-12-08 16:30     ` Scott Branden
2016-12-08 18:57       ` Catalin Marinas
2016-12-08 19:33         ` Scott Branden
2016-12-09 10:57           ` Will Deacon
2016-12-10  5:20             ` Scott Branden

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=1481139600-24455-2-git-send-email-scott.branden@broadcom.com \
    --to=scott.branden@broadcom.com \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=will.deacon@arm.com \
    /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

all inboxes | Powered by JetHome®