From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F6F3C433E0 for ; Wed, 20 Jan 2021 17:52:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 041B2223DB for ; Wed, 20 Jan 2021 17:52:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 041B2223DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kLfutefDGjkvuIGtaO2h3YFi1fSYNml7GIjZgwloL24=; b=nQRV8QMTWQfJTkvcNM2r2J4/b jqbdqYiZudOYpjOnLq+f3wjSrrdKsuUvSpwaiwoIlEbPR/XJZgzmMsiKjn9ziDGlvSWouHtByEBEj OxAauSV20uBA0QtgYQJxSyB7vNPY+eVmokP07dSuTGRuh35Nhb49FRDwM8lHI+cddJxcgznrv1u6b wlrL2hPpzRoAl8+qb8mKqE5LYEI8rmhcqmMs/qed7n4fEWqFfunXXtJju4NJKgA9MtHo5E/Ew0aQd DVjgKaW2UgH7k+PnvG+QAgvzyh6XVu1HoW8i+FfArwehwgkcAfPInJ854yg6wfVe/QKhVOQmuvwjz CygZQIj0g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2Hcj-0000l0-Pd; Wed, 20 Jan 2021 17:50:29 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2Hbw-0000Un-Ma for linux-arm-kernel@lists.infradead.org; Wed, 20 Jan 2021 17:49:55 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0FEEE22287; Wed, 20 Jan 2021 17:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611164978; bh=gWJ3LYkk8EdHO2U/O11zpJu6VZAjhVPlgiFK9NxvnQc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NzlzrhGhR64hLDNjdUnWz792iIICFwDeMfctE/Aq4GidHmoQV3zMFzq840JTrIKv9 sYTm0N5YeEIPwszztezGhkeO8kmA4ZWAsaw2oytAoxQD1u1LpM7QHEzGlP/X6fS0jD MwAGVg1fq8mG4WchHTH7wZrosxaDPdMKNIDdfk+5NoxZJ7ChNUUFbTOSFbxFd1LI3U Ukh/4h/GuSH0RK4Ct35Z0ytGFu0YcKeuP14lKpz11V2aDvEZCXypH95+fZ4T9xQrgr fEsiEbi97YuqZvSHp8a0ru87WJPT2oNXKNaAqHP8Kts9q1BLlTETFrx/tjCIvhL1Gd iKgxCND99RFUQ== Date: Wed, 20 Jan 2021 17:49:33 +0000 From: Will Deacon To: Sudarshan Rajagopalan Subject: Re: [PATCH 1/1] arm64: reduce section size for sparsemem Message-ID: <20210120174933.GA20981@willie-the-truck> References: <15cf9a2359197fee0168f820c5c904650d07939e.1610146597.git.sudaraja@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <15cf9a2359197fee0168f820c5c904650d07939e.1610146597.git.sudaraja@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210120_124941_394793_1F432410 X-CRM114-Status: GOOD ( 18.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , david@redhat.com, anshuman.khandual@arm.com, linux-kernel@vger.kernel.org, Mike Rapoport , Suren Baghdasaryan , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jan 08, 2021 at 03:16:00PM -0800, Sudarshan Rajagopalan wrote: > Reducing the section size helps reduce wastage of reserved memory > for huge memory holes in sparsemem model. But having a much smaller > section size bits could break PMD mappings for vmemmap and wouldn't > accomodate the highest order page for certain page size granule configs. > It is determined that SECTION_SIZE_BITS of 27 (128MB) could be ideal > default value for 4K_PAGES that gives least section size without breaking > PMD based vmemmap mappings. For simplicity, 16K_PAGES could follow the > same as 4K_PAGES. And the least SECTION_SIZE_BITS for 64K_PAGES is 29 > that could accomodate MAX_ORDER. > > Signed-off-by: Sudarshan Rajagopalan > Suggested-by: David Hildenbrand > Cc: Will Deacon > Cc: Anshuman Khandual > Cc: Mike Rapoport > Cc: Mark Rutland > Cc: Suren Baghdasaryan > --- > arch/arm64/include/asm/sparsemem.h | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/include/asm/sparsemem.h b/arch/arm64/include/asm/sparsemem.h > index 1f43fcc79738..ff08ff6b677c 100644 > --- a/arch/arm64/include/asm/sparsemem.h > +++ b/arch/arm64/include/asm/sparsemem.h > @@ -7,7 +7,13 @@ > > #ifdef CONFIG_SPARSEMEM > #define MAX_PHYSMEM_BITS CONFIG_ARM64_PA_BITS > -#define SECTION_SIZE_BITS 30 > -#endif > + > +#if defined(CONFIG_ARM64_4K_PAGES) || defined(CONFIG_ARM64_16K_PAGES) > +#define SECTION_SIZE_BITS 27 > +#else > +#define SECTION_SIZE_BITS 29 > +#endif /* CONFIG_ARM64_4K_PAGES || CONFIG_ARM64_16K_PAGES */ > + > +#endif /* CONFIG_SPARSEMEM*/ Please can you repost this in light of the comments from Anshuman? Thanks, Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel