From patchwork Wed Dec 7 19:40:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Branden X-Patchwork-Id: 9465125 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B517A60512 for ; Wed, 7 Dec 2016 19:42:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97A7228549 for ; Wed, 7 Dec 2016 19:42:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C85328560; Wed, 7 Dec 2016 19:42:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3B8D328549 for ; Wed, 7 Dec 2016 19:42:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cEi5F-0003iW-MW; Wed, 07 Dec 2016 19:40:53 +0000 Received: from mail-pg0-x22f.google.com ([2607:f8b0:400e:c05::22f]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cEi4u-0002dq-A2 for linux-arm-kernel@lists.infradead.org; Wed, 07 Dec 2016 19:40:33 +0000 Received: by mail-pg0-x22f.google.com with SMTP id 3so165182653pgd.0 for ; Wed, 07 Dec 2016 11:40:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rtYb934wWVYdcqIcCfbTs6qEwRUs1LaWGlkvCbdGIiE=; b=RuCwUzsfTg3g14v/FdjhM3RGwjtWPD+SDNybimJnRh9rP8hwcNHf7SlanGxmf2Ehov BF4ul/vRtntv+l7elaTUtjOd8dvbEkdkWYSoaB747/0nWveE7jncqkk2NMBzLWKIl5cL S4CpecT7HwYfHodg60iaTz77Gva0NN+fhtKGs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rtYb934wWVYdcqIcCfbTs6qEwRUs1LaWGlkvCbdGIiE=; b=WmjBFMEJpMGnqaf06r2WO9uOzBV7Gz2HVgu7EKzJHLpg57rxb0QoHDIHCoJMOS8xKC xURQJGjVAczPWinC1DPKI5qpFV52GUf3XOSs+tYeU7KnMxhnfsM20xzjHENfXIipGExT jD8wopGSag9J0n5e3pu0p+0SxY32SJpja6tsDHyFyA4UM4pX/P17xuWM/hyGXgH0GoDR /EN6nayLobNrm+lineYhWElrs5o6knEPEJBjOtjrBVRW+xu8eYt+4etmaBHIJNBBPNvG 6W3qH+nHAU5vXQRAphJUwrpuRJxgHqhUZqUG3BKCWZx2dcLl59POw287DKRQpEbhNY+b NE5A== X-Gm-Message-State: AKaTC02ukzWcUVuN+4ruWhJg0n49DmCFyvefzQhH8xuXiFuIdNapEdXaXWG86UM1cS8WD/yV X-Received: by 10.84.214.150 with SMTP id j22mr101050287pli.81.1481139611657; Wed, 07 Dec 2016 11:40:11 -0800 (PST) Received: from lbrmn-lnxub113.ric.broadcom.com ([192.19.224.250]) by smtp.gmail.com with ESMTPSA id u78sm39012342pfa.53.2016.12.07.11.40.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Dec 2016 11:40:10 -0800 (PST) From: Scott Branden To: Arnd Bergmann , Olof Johansson , Catalin Marinas , Will Deacon 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161207_114032_437191_3DBFB893 X-CRM114-Status: GOOD ( 13.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: BCM Kernel Feedback , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Scott Branden MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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