Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2261931pxu; Mon, 7 Dec 2020 01:39:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWEqtExf33uvy6e26/eU7fbX9X1YqfEp1Z5vOYc6Ek2CErwxuwzaoRUi9hk2pK+l9TNaW4 X-Received: by 2002:a17:906:4c55:: with SMTP id d21mr18144871ejw.116.1607333946059; Mon, 07 Dec 2020 01:39:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607333946; cv=none; d=google.com; s=arc-20160816; b=ztpZeTBIjOz3ZOy7Fdx5vgL36AeTKPwPXB0d2y9hSRmDP9V9HzHKi6/gmfhp50GPof 4U6i632gJuHAybfCVuQZPM+nvCbXYkCDiYdD7TjBQZmP/ybkdeUcEeJway+TMt8siMb4 vDgG6NGQVSPO/6kSSKpDNwA6fMxUw8RCIH88hic9H9VBAQ8HtaOVFdI4w8VKNDW5DLrC z8F/NgQONhOC/BM13izNhquDJQst4mCoSdytp7GYPZqTKufSkmO3Me45SpD56zSnZYc8 Ua7JiDhUJE3otomJG6udppyfjx6CpOTkaQ9n6o2ERe4rr8Dfc6TPi+bnSd4J1KhrTqMn 1+JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version; bh=+lR3mJXtRgp1dsRx/c6MKPhlwkTrMlNgFnpVxqKoyWc=; b=l/rk6JR9ZSsV7BM6dYNIALBCJW6V42btrWORLTKh9hEEf6ikgFqEJxbGy3eXsbkzju izwArdxHit1Mkn55X4LU78/gVKLxZU6GIST7WQvyG/5biZYEuu3ZGe4xZ3bZoOxMeTO/ yIr0F/a8Wvn9nuRJt8UBDNPYS4gq9XAZRagWxfwCI8CdgrWZL7Y1NxA3N7LeUGd/gyKo QXefQLQVMrh5aSe2tdbejgwS6AIg4uRT+FvCAdEaSamTe/58wVfgHlQxrXmZiiXE4GhE 3K3FybUlh5hXBlTfdlUOXqKIUYCv2aTC9n/Pwb8yI9RgHLUPWaBkuJ2wSwvjxP+e90hj RRfg== 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; 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 d1si4907504edr.28.2020.12.07.01.38.43; Mon, 07 Dec 2020 01:39:06 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726522AbgLGJfu (ORCPT + 99 others); Mon, 7 Dec 2020 04:35:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:54948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726402AbgLGJfu (ORCPT ); Mon, 7 Dec 2020 04:35:50 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9C02422ADF; Mon, 7 Dec 2020 09:35:09 +0000 (UTC) Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1kmCvD-00GiE8-2h; Mon, 07 Dec 2020 09:35:07 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 07 Dec 2020 09:35:06 +0000 From: Marc Zyngier To: Ard Biesheuvel Cc: Will Deacon , 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 Subject: Re: [PATCH] arm64: mm: decrease the section size to reduce the memory reserved for the page map In-Reply-To: References: <20201204014443.43329-1-liwei213@huawei.com> <20201204111347.GA844@willie-the-truck> User-Agent: Roundcube Webmail/1.4.9 Message-ID: <390f5f441d99a832f4b2425b46f6d971@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: ardb@kernel.org, will@kernel.org, liwei213@huawei.com, song.bao.hua@hisilicon.com, steve.capper@arm.com, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, rppt@linux.ibm.com, fengbaopeng2@hisilicon.com, butao@hisilicon.com, nsaenzjulienne@suse.de, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-12-07 09:09, Ard Biesheuvel wrote: > (+ 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? Most probably. We are already massively constraint on platforms such as TX1, and dividing the max allocatable range by 8 isn't going to make it work any better... M. -- Jazz is not dead. It just smells funny...