Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932655AbcLGTkP (ORCPT ); Wed, 7 Dec 2016 14:40:15 -0500 Received: from mail-pg0-f54.google.com ([74.125.83.54]:35646 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752748AbcLGTkM (ORCPT ); Wed, 7 Dec 2016 14:40:12 -0500 From: Scott Branden To: Arnd Bergmann , Olof Johansson , Catalin Marinas , Will Deacon Cc: BCM Kernel Feedback , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Scott Branden Subject: [PATCH 1/1] arm64: mm: add config options for page table configuration Date: Wed, 7 Dec 2016 11:40:00 -0800 Message-Id: <1481139600-24455-2-git-send-email-scott.branden@broadcom.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1481139600-24455-1-git-send-email-scott.branden@broadcom.com> References: <1481139600-24455-1-git-send-email-scott.branden@broadcom.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1888 Lines: 62 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 --- 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