Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2249981pxu; Mon, 7 Dec 2020 01:12:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyi2mcHdLUY5Ahj+INZztQDowq/MqCqEBjgn07WAJhDTodgc0ifo1dPv5OReG08hIUo6SgC X-Received: by 2002:a17:906:d19b:: with SMTP id c27mr18454321ejz.234.1607332340534; Mon, 07 Dec 2020 01:12:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607332340; cv=none; d=google.com; s=arc-20160816; b=pDT7TpIyVF+tXFDDIhyuWjTFm8/vZDV1OKP2rjLIZhZWYR0wgGTTB6zSlwpldmxM7N nHa6mVPOI5XyuwPSte2aCd2ttK+DkfSkNarTW7ktBxFB8vrFpultPbYAePrK+VKbkH32 X8TcoFXAP32iHZiNrQmR/XPE/xMWCMzGLoRosDkRrESoLTEZRuhMdu9VR3I1cvRFD7Ic TT5ztGrp8oi1XO/yLquw0GLckO24VDLkIsHyZLRMwyTuB3RNVW9gJYV36u9Q/9u6RidO nlscaGWPUEHHcKdjkMrs2m3GPHtzbDHQKYxZ9Ih1dK/6HzW547XUMiHNtq11ApKplMYD IoBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=DVnn1TVTAU4PZLO3EJOArYu4u2AcwWO6V8Q1WSJ3ifs=; b=GWGwsl3JaUggsCL+bwV0cGR90xqTj+1cO8qKRqRXG8xI5GIu/pg2tlFQSW2j6FnTbw iXNQvXVH9EsM6udXheXQANs4slo8eZ2DsVrrJRRBf99cKcvK04+Cz98OKiTMA5k2S2KV 1BXiPL3XOXq5Rppxb9l9X6YeyGuWhb5fccfOi6eQbBWzMpowBTEHYYrrBAtVRalJMu5H hFRrRM6v5Tvy1mFbr80UMoUHHovFaNiA/scHFWfPtXWwDxBOOj7EkFeNL4OMRNMNlvgh 91ON44c4G4nwKucwEdsT9UK+qPmwWgemKCFbvNPBrymg3DrC/xvERcYlG3YSySZeTMaB vlvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fjU/RNO5"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s21si8067027edc.368.2020.12.07.01.11.57; Mon, 07 Dec 2020 01:12:20 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fjU/RNO5"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726146AbgLGJJ4 (ORCPT + 99 others); Mon, 7 Dec 2020 04:09:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:43242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726024AbgLGJJz (ORCPT ); Mon, 7 Dec 2020 04:09:55 -0500 X-Gm-Message-State: AOAM530nHokhKR8eObaFxQXK+h6exLOLPkdP94xbHpANhKlUs8yqWl5h avsDJdLK69Evh1j0hd5YArgEhwdlhXlPDcCVzTU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607332158; bh=zeXLUbD69DJQRxwchh1DPhqWxvriQVslIApvnQjzLYo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fjU/RNO5aHHNlPYZVX2DRu34mv2SubeizvQVnooBZSudvI0DQoSLOuvMjUT3/s2So yu/0PLexNza5xiZqHYfs1djfhNgZ7FqZMngqCcXuWXpzMoHu/OkJswa3oE/OpkFjfb w4WQHncqstL3vqOPzW6Q0J7PrCV8zckQG8ocEStd6hOVyVKec1YQeroU9tZkV+9enk HM+3VPzG6Bh9/AvelLSfKvBIABoowRWbruW3wQzsBvCKnohtWPeBbqzXB+udUwTEKV F+mUSKV6UqVtZKbeLwSKoC02t2S4/ms4/+Tyf7KFLjIT0jFER8F5YVrNNxTMFKEjbC nqSU/tCcPnYpw== X-Received: by 2002:aca:b809:: with SMTP id i9mr11682796oif.174.1607332157482; Mon, 07 Dec 2020 01:09:17 -0800 (PST) MIME-Version: 1.0 References: <20201204014443.43329-1-liwei213@huawei.com> <20201204111347.GA844@willie-the-truck> In-Reply-To: <20201204111347.GA844@willie-the-truck> From: Ard Biesheuvel Date: Mon, 7 Dec 2020 10:09:06 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arm64: mm: decrease the section size to reduce the memory reserved for the page map To: Will Deacon , Marc Zyngier Cc: Wei Li , Barry Song , Steve Capper , Catalin Marinas , Linux Kernel Mailing List , Mike Rapoport , fengbaopeng2@hisilicon.com, butao@hisilicon.com, Nicolas Saenz Julienne , Linux ARM Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (+ Marc) On Fri, 4 Dec 2020 at 12:14, Will Deacon wrote: > > On Fri, Dec 04, 2020 at 09:44:43AM +0800, Wei Li wrote: > > 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 > > --- > > 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 > > We chose '30' to avoid running out of bits in the page flags. What changed? > > With this patch, I can trigger: > > ./include/linux/mmzone.h:1170:2: error: Allocator MAX_ORDER exceeds SECTION_SIZE > #error Allocator MAX_ORDER exceeds SECTION_SIZE > > if I bump up NR_CPUS and NODES_SHIFT. > Does this mean we will run into problems with the GICv3 ITS LPI tables again if we are forced to reduce MAX_ORDER to fit inside SECTION_SIZE_BITS?