Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp16885pxu; Thu, 3 Dec 2020 17:54:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJykcSnCy6+DkirgNktsDg/TMrGQeJaF+ofbwtbpvS5OxImxnnvbfyFEA9zja/uIqEsLXd4V X-Received: by 2002:a50:a6c9:: with SMTP id f9mr5417210edc.158.1607046858595; Thu, 03 Dec 2020 17:54:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607046858; cv=none; d=google.com; s=arc-20160816; b=uIw1bzUHz/mQyTF4gxOhLWRbdv/q9XN5abAK7ktZ+I15GJx8zgaXpMfIh5AedYCBSH uidqzXuMRY4h1HL23n+nesRvR2Fo7lIHklCM1aumK7AmkojMOWJKP8s3SQxl4nUZEzXF IUNCzEHrhQcblpVabC1QB3suZLr/Shq2d5zm2os+ph7yAB/JdSlbtFJdokxpmPVMjCq2 K0MsuGi1EZEpDJkHnKKd6bS1SVh56L712T6V/l5K+DO32VFMgTzUhR0Fxt/u7tgLxcvT y5tBS9k037Ks0mYNUBMVHW/zG8b3iTvTIyftBzJrV9THZoG73ZnlDWq9T4+HCtSqrmKT dw9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=m+7nlY72Z8fGspq0u6HGqSFh7m5y1tOedAswS3Ydq1I=; b=zOIEYltqSJHzVlcRGiSaLKbFJpnVaghJZ7z9j9wObcXUnyGHiGQYaKT/slB/V4fIFU 7UJBMGEyQFhSu6ELgv+tDItbuHH3UeIxBB85vgZmjbqRW/H264C1lWYANKTsKL2h9dIi M3UH5DjWJr0OjRADnhdiSELu8Tbt/lMvKeRWmk7znpmHr/BK34rhQ2x9A5C8m85Shtbg zFvubROCN2JpccRMwQuR6HW8qCsEF0lwpyqqNtr4uTz8SQ5XC0JZ024m9x7hVFOPzXG2 rWLBQ/0jjTNZ3nBC8xT5oCkEYfOgmtJ9FDLltXwE4vcIzpht4hkflQnht8RlscKHZ0/r d8/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d64si2009050edd.257.2020.12.03.17.53.54; Thu, 03 Dec 2020 17:54:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726294AbgLDBvZ convert rfc822-to-8bit (ORCPT + 99 others); Thu, 3 Dec 2020 20:51:25 -0500 Received: from szxga08-in.huawei.com ([45.249.212.255]:2330 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725849AbgLDBvY (ORCPT ); Thu, 3 Dec 2020 20:51:24 -0500 Received: from DGGEMM404-HUB.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4CnFyB1NRjz13Pqk; Fri, 4 Dec 2020 09:49:54 +0800 (CST) Received: from dggpemm000002.china.huawei.com (7.185.36.174) by DGGEMM404-HUB.china.huawei.com (10.3.20.212) with Microsoft SMTP Server (TLS) id 14.3.487.0; Fri, 4 Dec 2020 09:50:41 +0800 Received: from dggemi761-chm.china.huawei.com (10.1.198.147) by dggpemm000002.china.huawei.com (7.185.36.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1913.5; Fri, 4 Dec 2020 09:50:41 +0800 Received: from dggemi761-chm.china.huawei.com ([10.9.49.202]) by dggemi761-chm.china.huawei.com ([10.9.49.202]) with mapi id 15.01.1913.007; Fri, 4 Dec 2020 09:50:41 +0800 From: "Song Bao Hua (Barry Song)" To: "liwei (CM)" , "catalin.marinas@arm.com" , "rppt@linux.ibm.com" , "will@kernel.org" CC: fengbaopeng , "nsaenzjulienne@suse.de" , "steve.capper@arm.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , butao Subject: RE: [PATCH] arm64: mm: decrease the section size to reduce the memory reserved for the page map Thread-Topic: [PATCH] arm64: mm: decrease the section size to reduce the memory reserved for the page map Thread-Index: AQHWyd8Pm9rJc08RmUuZbQcVlySHKKnmKYSA Date: Fri, 4 Dec 2020 01:50:40 +0000 Message-ID: <731f9389df474a968b2799fa698821da@hisilicon.com> References: <20201204014443.43329-1-liwei213@huawei.com> In-Reply-To: <20201204014443.43329-1-liwei213@huawei.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.126.201.153] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: liwei (CM) > Sent: Friday, December 4, 2020 2:45 PM > To: catalin.marinas@arm.com; rppt@linux.ibm.com; will@kernel.org; liwei (CM) > > Cc: fengbaopeng ; nsaenzjulienne@suse.de; > steve.capper@arm.com; Song Bao Hua (Barry Song) ; > linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; butao > > Subject: [PATCH] arm64: mm: decrease the section size to reduce the memory > reserved for the page map > > For the memory hole, sparse memory model that define SPARSEMEM_VMEMMAP > do not free the reserved memory for the page map, decrease the section > size can reduce the waste of reserved memory. > > Signed-off-by: Wei Li > Signed-off-by: Baopeng Feng > Signed-off-by: Xia Qing > --- Reviewed-by: Barry Song When page size is 4K, for each 1GB memory, we need 16MB vmemmap; For each 128MB memory, we need 2MB vmemmap. So while we have memory hole like 928MB(1GB-64MB),if SECTION_SIZE_BITS is 30, we waste 15MB; if SECTION_SIZE_BITS is 27, we waste 1MB only. > arch/arm64/include/asm/sparsemem.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/sparsemem.h > b/arch/arm64/include/asm/sparsemem.h > index 1f43fcc79738..8963bd3def28 100644 > --- a/arch/arm64/include/asm/sparsemem.h > +++ b/arch/arm64/include/asm/sparsemem.h > @@ -7,7 +7,7 @@ > > #ifdef CONFIG_SPARSEMEM > #define MAX_PHYSMEM_BITS CONFIG_ARM64_PA_BITS > -#define SECTION_SIZE_BITS 30 > +#define SECTION_SIZE_BITS 27 > #endif > > #endif > -- > 2.15.0 Thanks Barry