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=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 5C4B9C2BA2B for ; Fri, 10 Apr 2020 06:46:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2449B20732 for ; Fri, 10 Apr 2020 06:46:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KXeuZ0Y3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726009AbgDJGqo (ORCPT ); Fri, 10 Apr 2020 02:46:44 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:28376 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725816AbgDJGqo (ORCPT ); Fri, 10 Apr 2020 02:46:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586501201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0zUfVt7mgJNJCuwkZj/ZTQSIXiHqwpNQ3G1o5Vhakx4=; b=KXeuZ0Y3Q4Fd1oRBxZdrCmwCr9pXYjt0e6MhyYKis8OyQqQr8KWvmUAOrdc70aWeFHfF9M KLhAI9PihDHgf0aaW9zMDYUVEPA6dJ1CAMSoXtCORYwLJsc/atu6GrOlNL8OCNgtZFOOQ1 YkBGCIYXta3WoMzYn0TjRL6M31G9pXM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-43-Z0rWAvSEOYaWut_WfuFMDw-1; Fri, 10 Apr 2020 02:46:36 -0400 X-MC-Unique: Z0rWAvSEOYaWut_WfuFMDw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 854D6107ACC4; Fri, 10 Apr 2020 06:46:31 +0000 (UTC) Received: from localhost (ovpn-13-236.pek2.redhat.com [10.72.13.236]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 21183272A6; Fri, 10 Apr 2020 06:46:29 +0000 (UTC) Date: Fri, 10 Apr 2020 14:46:26 +0800 From: Baoquan He To: Michal Hocko Cc: Mike Rapoport , Hoan Tran , Catalin Marinas , Will Deacon , Andrew Morton , Vlastimil Babka , Oscar Salvador , Pavel Tatashin , Alexander Duyck , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "David S. Miller" , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , "open list:MEMORY MANAGEMENT" , linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, lho@amperecomputing.com, mmorana@amperecomputing.com Subject: Re: [PATCH RFC] mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP (was: Re: [PATCH v3 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA) Message-ID: <20200410064626.GF2129@MiWiFi-R3L-srv> References: <1585420282-25630-1-git-send-email-Hoan@os.amperecomputing.com> <20200330074246.GA14243@dhcp22.suse.cz> <20200330092127.GB30942@linux.ibm.com> <20200330095843.GF14243@dhcp22.suse.cz> <20200331215618.GG30942@linux.ibm.com> <20200401054227.GC2129@MiWiFi-R3L-srv> <20200401075155.GH30942@linux.ibm.com> <20200402080144.GK22681@dhcp22.suse.cz> <20200409144119.GE2129@MiWiFi-R3L-srv> <20200409153321.GQ18386@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200409153321.GQ18386@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/09/20 at 05:33pm, Michal Hocko wrote: > On Thu 09-04-20 22:41:19, Baoquan He wrote: > > On 04/02/20 at 10:01am, Michal Hocko wrote: > > > On Wed 01-04-20 10:51:55, Mike Rapoport wrote: > > > > Hi, > > > > > > > > On Wed, Apr 01, 2020 at 01:42:27PM +0800, Baoquan He wrote: > > > [...] > > > > > From above information, we can remove HAVE_MEMBLOCK_NODE_MAP, and > > > > > replace it with CONFIG_NUMA. That sounds more sensible to store nid into > > > > > memblock when NUMA support is enabled. > > > > > > > > Replacing CONFIG_HAVE_MEMBLOCK_NODE_MAP with CONFIG_NUMA will work, but > > > > this will not help cleaning up the whole node/zone initialization mess and > > > > we'll be stuck with two implementations. > > > > > > Yeah, this is far from optimal. > > > > > > > The overhead of enabling HAVE_MEMBLOCK_NODE_MAP is only for init time as > > > > most architectures will anyway discard the entire memblock, so having it in > > > > a UMA arch won't be a problem. The only exception is arm that uses > > > > memblock for pfn_valid(), here we may also think about a solution to > > > > compensate the addition of nid to the memblock structures. > > > > > > Well, we can make memblock_region->nid defined only for CONFIG_NUMA. > > > memblock_get_region_node would then unconditionally return 0 on UMA. > > > Essentially the same way we do NUMA for other MM code. I only see few > > > direct usage of region->nid. > > > > Checked code again, seems HAVE_MEMBLOCK_NODE_MAP is selected directly in > > all ARCHes which support it. Means HAVE_MEMBLOCK_NODE_MAP is enabled by > > default on those ARCHes, and has no dependency on CONFIG_NUMA at all. > > E.g on x86, it just calls free_area_init_nodes() in generic code path, > > while free_area_init_nodes() is defined in CONFIG_HAVE_MEMBLOCK_NODE_MAP > > ifdeffery scope. So I tend to agree with Mike to remove > > HAVE_MEMBLOCK_NODE_MAP firstly on all ARCHes. We can check if it's worth > > only defining memblock_region->nid for CONFIG_NUMA case after > > HAVE_MEMBLOCK_NODE_MAP is removed. > > This can surely go in separate patches. What I meant to say is the > region->nid is by definition 0 on !CONFIG_NUMA. I see, thanks. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Baoquan He Date: Fri, 10 Apr 2020 06:46:26 +0000 Subject: Re: [PATCH RFC] mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP (was: Re: [PATCH v3 0/5] mm: Enable CONFIG_ Message-Id: <20200410064626.GF2129@MiWiFi-R3L-srv> List-Id: References: <1585420282-25630-1-git-send-email-Hoan@os.amperecomputing.com> <20200330074246.GA14243@dhcp22.suse.cz> <20200330092127.GB30942@linux.ibm.com> <20200330095843.GF14243@dhcp22.suse.cz> <20200331215618.GG30942@linux.ibm.com> <20200401054227.GC2129@MiWiFi-R3L-srv> <20200401075155.GH30942@linux.ibm.com> <20200402080144.GK22681@dhcp22.suse.cz> <20200409144119.GE2129@MiWiFi-R3L-srv> <20200409153321.GQ18386@dhcp22.suse.cz> In-Reply-To: <20200409153321.GQ18386@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Michal Hocko Cc: mmorana@amperecomputing.com, Catalin Marinas , Heiko Carstens , "open list:MEMORY MANAGEMENT" , Paul Mackerras , "H. Peter Anvin" , sparclinux@vger.kernel.org, Alexander Duyck , linux-s390@vger.kernel.org, Michael Ellerman , x86@kernel.org, Mike Rapoport , Christian Borntraeger , Ingo Molnar , Hoan Tran , Benjamin Herrenschmidt , Pavel Tatashin , lho@amperecomputing.com, Vasily Gorbik , Vlastimil Babka , Will Deacon , Borislav Petkov , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Oscar Salvador , linux-kernel@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org, "David S. Miller" On 04/09/20 at 05:33pm, Michal Hocko wrote: > On Thu 09-04-20 22:41:19, Baoquan He wrote: > > On 04/02/20 at 10:01am, Michal Hocko wrote: > > > On Wed 01-04-20 10:51:55, Mike Rapoport wrote: > > > > Hi, > > > > > > > > On Wed, Apr 01, 2020 at 01:42:27PM +0800, Baoquan He wrote: > > > [...] > > > > > From above information, we can remove HAVE_MEMBLOCK_NODE_MAP, and > > > > > replace it with CONFIG_NUMA. That sounds more sensible to store nid into > > > > > memblock when NUMA support is enabled. > > > > > > > > Replacing CONFIG_HAVE_MEMBLOCK_NODE_MAP with CONFIG_NUMA will work, but > > > > this will not help cleaning up the whole node/zone initialization mess and > > > > we'll be stuck with two implementations. > > > > > > Yeah, this is far from optimal. > > > > > > > The overhead of enabling HAVE_MEMBLOCK_NODE_MAP is only for init time as > > > > most architectures will anyway discard the entire memblock, so having it in > > > > a UMA arch won't be a problem. The only exception is arm that uses > > > > memblock for pfn_valid(), here we may also think about a solution to > > > > compensate the addition of nid to the memblock structures. > > > > > > Well, we can make memblock_region->nid defined only for CONFIG_NUMA. > > > memblock_get_region_node would then unconditionally return 0 on UMA. > > > Essentially the same way we do NUMA for other MM code. I only see few > > > direct usage of region->nid. > > > > Checked code again, seems HAVE_MEMBLOCK_NODE_MAP is selected directly in > > all ARCHes which support it. Means HAVE_MEMBLOCK_NODE_MAP is enabled by > > default on those ARCHes, and has no dependency on CONFIG_NUMA at all. > > E.g on x86, it just calls free_area_init_nodes() in generic code path, > > while free_area_init_nodes() is defined in CONFIG_HAVE_MEMBLOCK_NODE_MAP > > ifdeffery scope. So I tend to agree with Mike to remove > > HAVE_MEMBLOCK_NODE_MAP firstly on all ARCHes. We can check if it's worth > > only defining memblock_region->nid for CONFIG_NUMA case after > > HAVE_MEMBLOCK_NODE_MAP is removed. > > This can surely go in separate patches. What I meant to say is the > region->nid is by definition 0 on !CONFIG_NUMA. I see, thanks. 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=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 0F94EC2BA2B for ; Fri, 10 Apr 2020 06:49:14 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 6786A20732 for ; Fri, 10 Apr 2020 06:49:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OUFkpu2K"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OUFkpu2K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6786A20732 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48z7sL1vTkzDqbl for ; Fri, 10 Apr 2020 16:49:10 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=207.211.31.81; helo=us-smtp-delivery-1.mimecast.com; envelope-from=bhe@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OUFkpu2K; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OUFkpu2K; dkim-atps=neutral Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48z7pb2PrzzDrK2 for ; Fri, 10 Apr 2020 16:46:44 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586501199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0zUfVt7mgJNJCuwkZj/ZTQSIXiHqwpNQ3G1o5Vhakx4=; b=OUFkpu2KRszv7fPmsi7bBJEFmC4idZOiFPGm5dcfxB2O6iniJzmCDwjrWRX0wgvMh77q4R HWd7QvS2P2BqUtArhSRpzZLpSQyHgHq2uLrJ8EyyDM7MqHsKrv1/7stLRG0hNawCLFZ8AR I2XvlRUjcBllnML4F4kjUDGBcIVUMuE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586501199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0zUfVt7mgJNJCuwkZj/ZTQSIXiHqwpNQ3G1o5Vhakx4=; b=OUFkpu2KRszv7fPmsi7bBJEFmC4idZOiFPGm5dcfxB2O6iniJzmCDwjrWRX0wgvMh77q4R HWd7QvS2P2BqUtArhSRpzZLpSQyHgHq2uLrJ8EyyDM7MqHsKrv1/7stLRG0hNawCLFZ8AR I2XvlRUjcBllnML4F4kjUDGBcIVUMuE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-43-Z0rWAvSEOYaWut_WfuFMDw-1; Fri, 10 Apr 2020 02:46:36 -0400 X-MC-Unique: Z0rWAvSEOYaWut_WfuFMDw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 854D6107ACC4; Fri, 10 Apr 2020 06:46:31 +0000 (UTC) Received: from localhost (ovpn-13-236.pek2.redhat.com [10.72.13.236]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 21183272A6; Fri, 10 Apr 2020 06:46:29 +0000 (UTC) Date: Fri, 10 Apr 2020 14:46:26 +0800 From: Baoquan He To: Michal Hocko Subject: Re: [PATCH RFC] mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP (was: Re: [PATCH v3 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA) Message-ID: <20200410064626.GF2129@MiWiFi-R3L-srv> References: <1585420282-25630-1-git-send-email-Hoan@os.amperecomputing.com> <20200330074246.GA14243@dhcp22.suse.cz> <20200330092127.GB30942@linux.ibm.com> <20200330095843.GF14243@dhcp22.suse.cz> <20200331215618.GG30942@linux.ibm.com> <20200401054227.GC2129@MiWiFi-R3L-srv> <20200401075155.GH30942@linux.ibm.com> <20200402080144.GK22681@dhcp22.suse.cz> <20200409144119.GE2129@MiWiFi-R3L-srv> <20200409153321.GQ18386@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200409153321.GQ18386@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mmorana@amperecomputing.com, Catalin Marinas , Heiko Carstens , "open list:MEMORY MANAGEMENT" , Paul Mackerras , "H. Peter Anvin" , sparclinux@vger.kernel.org, Alexander Duyck , linux-s390@vger.kernel.org, x86@kernel.org, Mike Rapoport , Christian Borntraeger , Ingo Molnar , Hoan Tran , Pavel Tatashin , lho@amperecomputing.com, Vasily Gorbik , Vlastimil Babka , Will Deacon , Borislav Petkov , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Oscar Salvador , linux-kernel@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 04/09/20 at 05:33pm, Michal Hocko wrote: > On Thu 09-04-20 22:41:19, Baoquan He wrote: > > On 04/02/20 at 10:01am, Michal Hocko wrote: > > > On Wed 01-04-20 10:51:55, Mike Rapoport wrote: > > > > Hi, > > > > > > > > On Wed, Apr 01, 2020 at 01:42:27PM +0800, Baoquan He wrote: > > > [...] > > > > > From above information, we can remove HAVE_MEMBLOCK_NODE_MAP, and > > > > > replace it with CONFIG_NUMA. That sounds more sensible to store nid into > > > > > memblock when NUMA support is enabled. > > > > > > > > Replacing CONFIG_HAVE_MEMBLOCK_NODE_MAP with CONFIG_NUMA will work, but > > > > this will not help cleaning up the whole node/zone initialization mess and > > > > we'll be stuck with two implementations. > > > > > > Yeah, this is far from optimal. > > > > > > > The overhead of enabling HAVE_MEMBLOCK_NODE_MAP is only for init time as > > > > most architectures will anyway discard the entire memblock, so having it in > > > > a UMA arch won't be a problem. The only exception is arm that uses > > > > memblock for pfn_valid(), here we may also think about a solution to > > > > compensate the addition of nid to the memblock structures. > > > > > > Well, we can make memblock_region->nid defined only for CONFIG_NUMA. > > > memblock_get_region_node would then unconditionally return 0 on UMA. > > > Essentially the same way we do NUMA for other MM code. I only see few > > > direct usage of region->nid. > > > > Checked code again, seems HAVE_MEMBLOCK_NODE_MAP is selected directly in > > all ARCHes which support it. Means HAVE_MEMBLOCK_NODE_MAP is enabled by > > default on those ARCHes, and has no dependency on CONFIG_NUMA at all. > > E.g on x86, it just calls free_area_init_nodes() in generic code path, > > while free_area_init_nodes() is defined in CONFIG_HAVE_MEMBLOCK_NODE_MAP > > ifdeffery scope. So I tend to agree with Mike to remove > > HAVE_MEMBLOCK_NODE_MAP firstly on all ARCHes. We can check if it's worth > > only defining memblock_region->nid for CONFIG_NUMA case after > > HAVE_MEMBLOCK_NODE_MAP is removed. > > This can surely go in separate patches. What I meant to say is the > region->nid is by definition 0 on !CONFIG_NUMA. I see, thanks. 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=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 E8E12C2BA2B for ; Fri, 10 Apr 2020 06:46:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 BD94820732 for ; Fri, 10 Apr 2020 06:46:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rGR7O2j2"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KXeuZ0Y3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD94820732 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.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=DoZWu++kAOFXTEPsEMpW4Bn/IoRNIaBS+AnepactlrE=; b=rGR7O2j2iymtzL qojUDX83hwmQQ0QJ7uJtswjS/0KgUxmHiW1m9emGRHF491EGb63oWyc5lXaIeKkZW+42opQnsxy7P HH1Gbmy3A13M6eZDgE0ar3XSANkZlG419qxKWCu6F14au6iOg0uDqZdsaNhwj//otx14e+gnPeJgl eABYou1uxadaVFA8k8XLv0iI9UU8F/e7dUNCHtDyK6yT8CrCrhFbvGwS4uSt+JVyrYxA+4pfgkF9T cf+LMdKmttAWGIuPR5x0HsX26n95TxEUbX0BrakacP77/F8LvlgKuU08VcaJ91jTCc/Qj9TPKpZUY 8OnVCke5JarHHNjQ5cNQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jMnRC-0006aW-Fn; Fri, 10 Apr 2020 06:46:50 +0000 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120] helo=us-smtp-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jMnR9-0006ZO-77 for linux-arm-kernel@lists.infradead.org; Fri, 10 Apr 2020 06:46:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586501201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0zUfVt7mgJNJCuwkZj/ZTQSIXiHqwpNQ3G1o5Vhakx4=; b=KXeuZ0Y3Q4Fd1oRBxZdrCmwCr9pXYjt0e6MhyYKis8OyQqQr8KWvmUAOrdc70aWeFHfF9M KLhAI9PihDHgf0aaW9zMDYUVEPA6dJ1CAMSoXtCORYwLJsc/atu6GrOlNL8OCNgtZFOOQ1 YkBGCIYXta3WoMzYn0TjRL6M31G9pXM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-43-Z0rWAvSEOYaWut_WfuFMDw-1; Fri, 10 Apr 2020 02:46:36 -0400 X-MC-Unique: Z0rWAvSEOYaWut_WfuFMDw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 854D6107ACC4; Fri, 10 Apr 2020 06:46:31 +0000 (UTC) Received: from localhost (ovpn-13-236.pek2.redhat.com [10.72.13.236]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 21183272A6; Fri, 10 Apr 2020 06:46:29 +0000 (UTC) Date: Fri, 10 Apr 2020 14:46:26 +0800 From: Baoquan He To: Michal Hocko Subject: Re: [PATCH RFC] mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP (was: Re: [PATCH v3 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA) Message-ID: <20200410064626.GF2129@MiWiFi-R3L-srv> References: <1585420282-25630-1-git-send-email-Hoan@os.amperecomputing.com> <20200330074246.GA14243@dhcp22.suse.cz> <20200330092127.GB30942@linux.ibm.com> <20200330095843.GF14243@dhcp22.suse.cz> <20200331215618.GG30942@linux.ibm.com> <20200401054227.GC2129@MiWiFi-R3L-srv> <20200401075155.GH30942@linux.ibm.com> <20200402080144.GK22681@dhcp22.suse.cz> <20200409144119.GE2129@MiWiFi-R3L-srv> <20200409153321.GQ18386@dhcp22.suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200409153321.GQ18386@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200409_234647_336390_E35F61EA X-CRM114-Status: GOOD ( 26.15 ) 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: mmorana@amperecomputing.com, Catalin Marinas , Heiko Carstens , "open list:MEMORY MANAGEMENT" , Paul Mackerras , "H. Peter Anvin" , sparclinux@vger.kernel.org, Alexander Duyck , linux-s390@vger.kernel.org, Michael Ellerman , x86@kernel.org, Mike Rapoport , Christian Borntraeger , Ingo Molnar , Hoan Tran , Benjamin Herrenschmidt , Pavel Tatashin , lho@amperecomputing.com, Vasily Gorbik , Vlastimil Babka , Will Deacon , Borislav Petkov , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Oscar Salvador , linux-kernel@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 04/09/20 at 05:33pm, Michal Hocko wrote: > On Thu 09-04-20 22:41:19, Baoquan He wrote: > > On 04/02/20 at 10:01am, Michal Hocko wrote: > > > On Wed 01-04-20 10:51:55, Mike Rapoport wrote: > > > > Hi, > > > > > > > > On Wed, Apr 01, 2020 at 01:42:27PM +0800, Baoquan He wrote: > > > [...] > > > > > From above information, we can remove HAVE_MEMBLOCK_NODE_MAP, and > > > > > replace it with CONFIG_NUMA. That sounds more sensible to store nid into > > > > > memblock when NUMA support is enabled. > > > > > > > > Replacing CONFIG_HAVE_MEMBLOCK_NODE_MAP with CONFIG_NUMA will work, but > > > > this will not help cleaning up the whole node/zone initialization mess and > > > > we'll be stuck with two implementations. > > > > > > Yeah, this is far from optimal. > > > > > > > The overhead of enabling HAVE_MEMBLOCK_NODE_MAP is only for init time as > > > > most architectures will anyway discard the entire memblock, so having it in > > > > a UMA arch won't be a problem. The only exception is arm that uses > > > > memblock for pfn_valid(), here we may also think about a solution to > > > > compensate the addition of nid to the memblock structures. > > > > > > Well, we can make memblock_region->nid defined only for CONFIG_NUMA. > > > memblock_get_region_node would then unconditionally return 0 on UMA. > > > Essentially the same way we do NUMA for other MM code. I only see few > > > direct usage of region->nid. > > > > Checked code again, seems HAVE_MEMBLOCK_NODE_MAP is selected directly in > > all ARCHes which support it. Means HAVE_MEMBLOCK_NODE_MAP is enabled by > > default on those ARCHes, and has no dependency on CONFIG_NUMA at all. > > E.g on x86, it just calls free_area_init_nodes() in generic code path, > > while free_area_init_nodes() is defined in CONFIG_HAVE_MEMBLOCK_NODE_MAP > > ifdeffery scope. So I tend to agree with Mike to remove > > HAVE_MEMBLOCK_NODE_MAP firstly on all ARCHes. We can check if it's worth > > only defining memblock_region->nid for CONFIG_NUMA case after > > HAVE_MEMBLOCK_NODE_MAP is removed. > > This can surely go in separate patches. What I meant to say is the > region->nid is by definition 0 on !CONFIG_NUMA. I see, thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel