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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71A84C433F5 for ; Mon, 27 Sep 2021 03:25:59 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 388F560F94 for ; Mon, 27 Sep 2021 03:25:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 388F560F94 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.196281.349051 (Exim 4.92) (envelope-from ) id 1mUhGz-0005kO-Ix; Mon, 27 Sep 2021 03:25:45 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 196281.349051; Mon, 27 Sep 2021 03:25:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mUhGz-0005kH-Fy; Mon, 27 Sep 2021 03:25:45 +0000 Received: by outflank-mailman (input) for mailman id 196281; Mon, 27 Sep 2021 03:25:44 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mUhGy-0005kB-9k for xen-devel@lists.xenproject.org; Mon, 27 Sep 2021 03:25:44 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 988b2f6c-1f42-11ec-bc3d-12813bfff9fa; Mon, 27 Sep 2021 03:25:43 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 825CF60FED; Mon, 27 Sep 2021 03:25:42 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 988b2f6c-1f42-11ec-bc3d-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632713142; bh=6ZAemB+n9XgH6FGRuRLlgBbacK01h5ysUjv5fAYyDi0=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=S5dK702KQ89G+93xNqPSAPNJgOqRz7Q9qBLCthmpUXT550pZHUr3NmM5rSuDWeyKD 1pPypqSMPaJhxgk6Eig4wH7iWqllJ451o6lByfuZl7BxuuabwvlNxoIUaWOLDP3m+C 5KMd7csnsIlDPXkuaStFjCmgvaEBPbergNyNx7n4fb4vccFFtWH1VlwlyhpfvnTAlY KF66xXIKYkJm3KUyjpz1mdxmvmletp/KhPeDZ562TjpfESNp70d1ac2Dw0e23UcGc3 grlfFaW0t/S/hiYut8ZBZrqWf/clZ2xg49NF2vrSfU1NJ+ejjHxI5swT7ian2sAqzs JaLFsZbY5znYQ== Date: Sun, 26 Sep 2021 20:25:42 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: Wei Chen cc: Stefano Stabellini , "xen-devel@lists.xenproject.org" , "julien@xen.org" , Bertrand Marquis Subject: RE: [PATCH 22/37] xen/arm: use NR_MEM_BANKS to override default NR_NODE_MEMBLKS In-Reply-To: Message-ID: References: <20210923120236.3692135-1-wei.chen@arm.com> <20210923120236.3692135-23-wei.chen@arm.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1750427606-1632713142=:5022" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1750427606-1632713142=:5022 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Sun, 26 Sep 2021, Wei Chen wrote: > > -----Original Message----- > > From: Stefano Stabellini > > Sent: 2021年9月24日 9:35 > > To: Wei Chen > > Cc: xen-devel@lists.xenproject.org; sstabellini@kernel.org; julien@xen.org; > > Bertrand Marquis > > Subject: Re: [PATCH 22/37] xen/arm: use NR_MEM_BANKS to override default > > NR_NODE_MEMBLKS > > > > On Thu, 23 Sep 2021, Wei Chen wrote: > > > As a memory range described in device tree cannot be split across > > > multiple nodes. So we define NR_NODE_MEMBLKS as NR_MEM_BANKS in > > > arch header. > > > > This statement is true but what is the goal of this patch? Is it to > > reduce code size and memory consumption? > > > > No, when Julien and I discussed this in last version[1], we hadn't thought > so deeply. We just thought a memory range described in DT cannot be split > across multiple nodes. So NR_MEM_BANKS should be equal to NR_MEM_BANKS. > > https://lists.xenproject.org/archives/html/xen-devel/2021-08/msg00974.html > > > I am asking because NR_MEM_BANKS is 128 and > > NR_NODE_MEMBLKS=2*MAX_NUMNODES which is 64 by default so again > > NR_NODE_MEMBLKS is 128 before this patch. > > > > In other words, this patch alone doesn't make any difference; at least > > doesn't make any difference unless CONFIG_NR_NUMA_NODES is increased. > > > > So, is the goal to reduce memory usage when CONFIG_NR_NUMA_NODES is > > higher than 64? > > > > I also thought about this problem when I was writing this patch. > CONFIG_NR_NUMA_NODES is increasing, but NR_MEM_BANKS is a fixed > value, then NR_MEM_BANKS can be smaller than CONFIG_NR_NUMA_NODES > at one point. > > But I agree with Julien's suggestion, NR_MEM_BANKS and NR_NODE_MEMBLKS > must be aware of each other. I had thought to add some ASSERT check, > but I don't know how to do it better. So I post this patch for more > suggestion. OK. In that case I'd say to get rid of the previous definition of NR_NODE_MEMBLKS as it is probably not necessary, see below. > > > > > And keep default NR_NODE_MEMBLKS in common header > > > for those architectures NUMA is disabled. > > > > This last sentence is not accurate: on x86 NUMA is enabled and > > NR_NODE_MEMBLKS is still defined in xen/include/xen/numa.h (there is no > > x86 definition of it) > > > > Yes. > > > > > > Signed-off-by: Wei Chen > > > --- > > > xen/include/asm-arm/numa.h | 8 +++++++- > > > xen/include/xen/numa.h | 2 ++ > > > 2 files changed, 9 insertions(+), 1 deletion(-) > > > > > > diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h > > > index 8f1c67e3eb..21569e634b 100644 > > > --- a/xen/include/asm-arm/numa.h > > > +++ b/xen/include/asm-arm/numa.h > > > @@ -3,9 +3,15 @@ > > > > > > #include > > > > > > +#include > > > + > > > typedef u8 nodeid_t; > > > > > > -#ifndef CONFIG_NUMA > > > +#ifdef CONFIG_NUMA > > > + > > > +#define NR_NODE_MEMBLKS NR_MEM_BANKS > > > + > > > +#else > > > > > > /* Fake one node for now. See also node_online_map. */ > > > #define cpu_to_node(cpu) 0 > > > diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h > > > index 1978e2be1b..1731e1cc6b 100644 > > > --- a/xen/include/xen/numa.h > > > +++ b/xen/include/xen/numa.h > > > @@ -12,7 +12,9 @@ > > > #define MAX_NUMNODES 1 > > > #endif > > > > > > +#ifndef NR_NODE_MEMBLKS > > > #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) > > > +#endif This one we can remove it completely right? --8323329-1750427606-1632713142=:5022--