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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 66BACC4361A for ; Fri, 4 Dec 2020 11:45:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D27DC229F0 for ; Fri, 4 Dec 2020 11:45:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730057AbgLDLp2 (ORCPT ); Fri, 4 Dec 2020 06:45:28 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:9470 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729779AbgLDLp2 (ORCPT ); Fri, 4 Dec 2020 06:45:28 -0500 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0B4BXXPZ104298; Fri, 4 Dec 2020 06:44:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=BxocSLlgfloMe6T+L8rIEKZtxjAGh/dLtKfxgPAFIvQ=; b=lnW9X/vNLrljm4wrEBQBJReMOJ7THvwkIAxhJ1oj5weSlgzWlMnNJvLFEBtsLWUt21fn W2DefjL8xXLy8wr/UymSIsgAQ0yg06eStdg/G2/FS5BXSl5MUcvtF7eoF1gz2X8bTt2p S4PY0pFIb6Z1Em+rpnX2jltx5Tt/zuRuMcoqbEnBiMo9H0yGsQUp2iP2BmvryT3fmwwy WLXqb7EVhoa9QrPwG2hZH77lwRzewMiVhhdYeaZwS2AS2zHRROj/m+9a9NY3VsK9pOdO jRygdDHzbwptKh9UUS6/EaMSlID/gOt8yycHZqPVNggDZyi13UzijVDg2iRa6hsFAjbO +Q== Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com with ESMTP id 35773521mw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Dec 2020 06:44:08 -0500 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0B4BcCcC023793; Fri, 4 Dec 2020 11:44:06 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma06fra.de.ibm.com with ESMTP id 353dthb8ge-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Dec 2020 11:44:06 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0B4Bi3ms4588224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 4 Dec 2020 11:44:04 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E1925A4040; Fri, 4 Dec 2020 11:44:03 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BAADAA404D; Fri, 4 Dec 2020 11:44:02 +0000 (GMT) Received: from linux.ibm.com (unknown [9.145.50.18]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 4 Dec 2020 11:44:02 +0000 (GMT) Date: Fri, 4 Dec 2020 13:44:00 +0200 From: Mike Rapoport To: Will Deacon Cc: Wei Li , catalin.marinas@arm.com, fengbaopeng2@hisilicon.com, nsaenzjulienne@suse.de, steve.capper@arm.com, song.bao.hua@hisilicon.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, butao@hisilicon.com Subject: Re: [PATCH] arm64: mm: decrease the section size to reduce the memory reserved for the page map Message-ID: <20201204114400.GT123287@linux.ibm.com> References: <20201204014443.43329-1-liwei213@huawei.com> <20201204111347.GA844@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201204111347.GA844@willie-the-truck> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-12-04_03:2020-12-04,2020-12-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=562 spamscore=0 phishscore=0 clxscore=1011 priorityscore=1501 mlxscore=0 bulkscore=0 impostorscore=0 adultscore=0 suspectscore=5 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012040071 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 04, 2020 at 11:13:47AM +0000, 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? I think that for 64-bit there are still plenty of free bits. I didn't check now, but when I played with SPARSEMEM on m68k there were 8 bits for section out of 32. > 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. I don't think it's related to NR_CPUS and NODES_SHIFT. This seems rather 64K pages that cause this. Not that is shouldn't be addressed. > Will -- Sincerely yours, Mike. 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.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 7B174C4361A for ; Fri, 4 Dec 2020 11:46:11 +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 F0CB22251D for ; Fri, 4 Dec 2020 11:46:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F0CB22251D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com 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=veMtKgD5rB/hBiQ9EDGe9idyUW1yQrT8A0Kx3ioSPJw=; b=zHWRz+0RHVxd1P/8kMCazMZxQ 5p065YZNFoWaVyVkSnmEzDeRvycFIylid3PiQPqut4RSTiiXWj9A7zSCYzwFiWXtizMh+y8yZ0Aga dS5eXHj+uwSNSBKPsqmISdfutR1FzegKBwLFDEvRP5+mXrMYuTK+JwYFEI6WX0IjG0+7VJi0g8jvl iMIq9bw7jbUtnD72j3g938vU9XVmssl17a6If7F0ImBFOuze/GKUPNn6pRLPQEjkWidTCKGj0u2S/ mVO+BpYWiBN2vlCEUVs/UVt3ulOez5szNxZBEGXrQ9rM1a08xlGEjaVKNSLlDqVZn324bELLiwLou qWfVeeI5Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kl9W3-0001Va-QY; Fri, 04 Dec 2020 11:44:47 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kl9W0-0001Ui-AT for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2020 11:44:45 +0000 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0B4BXXPZ104298; Fri, 4 Dec 2020 06:44:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=BxocSLlgfloMe6T+L8rIEKZtxjAGh/dLtKfxgPAFIvQ=; b=lnW9X/vNLrljm4wrEBQBJReMOJ7THvwkIAxhJ1oj5weSlgzWlMnNJvLFEBtsLWUt21fn W2DefjL8xXLy8wr/UymSIsgAQ0yg06eStdg/G2/FS5BXSl5MUcvtF7eoF1gz2X8bTt2p S4PY0pFIb6Z1Em+rpnX2jltx5Tt/zuRuMcoqbEnBiMo9H0yGsQUp2iP2BmvryT3fmwwy WLXqb7EVhoa9QrPwG2hZH77lwRzewMiVhhdYeaZwS2AS2zHRROj/m+9a9NY3VsK9pOdO jRygdDHzbwptKh9UUS6/EaMSlID/gOt8yycHZqPVNggDZyi13UzijVDg2iRa6hsFAjbO +Q== Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com with ESMTP id 35773521mw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Dec 2020 06:44:08 -0500 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0B4BcCcC023793; Fri, 4 Dec 2020 11:44:06 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma06fra.de.ibm.com with ESMTP id 353dthb8ge-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Dec 2020 11:44:06 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0B4Bi3ms4588224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 4 Dec 2020 11:44:04 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E1925A4040; Fri, 4 Dec 2020 11:44:03 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BAADAA404D; Fri, 4 Dec 2020 11:44:02 +0000 (GMT) Received: from linux.ibm.com (unknown [9.145.50.18]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 4 Dec 2020 11:44:02 +0000 (GMT) Date: Fri, 4 Dec 2020 13:44:00 +0200 From: Mike Rapoport To: Will Deacon Subject: Re: [PATCH] arm64: mm: decrease the section size to reduce the memory reserved for the page map Message-ID: <20201204114400.GT123287@linux.ibm.com> References: <20201204014443.43329-1-liwei213@huawei.com> <20201204111347.GA844@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201204111347.GA844@willie-the-truck> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-12-04_03:2020-12-04, 2020-12-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=562 spamscore=0 phishscore=0 clxscore=1011 priorityscore=1501 mlxscore=0 bulkscore=0 impostorscore=0 adultscore=0 suspectscore=5 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012040071 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201204_064444_750946_99858A6D X-CRM114-Status: GOOD ( 27.87 ) 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: song.bao.hua@hisilicon.com, linux-arm-kernel@lists.infradead.org, steve.capper@arm.com, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, Wei Li , butao@hisilicon.com, nsaenzjulienne@suse.de, fengbaopeng2@hisilicon.com 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, Dec 04, 2020 at 11:13:47AM +0000, 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? I think that for 64-bit there are still plenty of free bits. I didn't check now, but when I played with SPARSEMEM on m68k there were 8 bits for section out of 32. > 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. I don't think it's related to NR_CPUS and NODES_SHIFT. This seems rather 64K pages that cause this. Not that is shouldn't be addressed. > Will -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel