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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id ED7B1C4167B for ; Mon, 13 Nov 2023 04:05:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FnUQv+6Llo5Fb8iW4cRhfCeCWpMRsv0rb8WuknNeaQI=; b=ivvOPMZ6KUeuT6 w07A6tlEjFLIYq2jADWYW+Oubi5fEIDX/hDucTcDfevLW6ksytkpkKowDyrdPtdX/vu86ki5ushqa MchE82B4lFlss6Yvsz46/mWsE/9tidR7fs8tm9r8LHKPRXa9Fuo5pYxrVdGcLUUknWvy2FHvXHiPH as1DGKVsgjtya+SvMffTo9SGdWLGp4qAdM6CsWd68rzXCCMuFYJCzuj8YNi2wa4SIDibZsUD/q9IZ t4RuF2ee0DYzbXrbWmFEek9k7N/FZa/BVFbcjgwPEG8RZpqciERr9ULjBib+bws5sQ5amFPsII7sI sQ8YxiuqueIBLk5PX8FA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2OBs-00DBR9-0w; Mon, 13 Nov 2023 04:04:48 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2OBp-00DBQ4-32 for linux-arm-kernel@lists.infradead.org; Mon, 13 Nov 2023 04:04:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699848285; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tws2IAPG/pAuM74CEbXNr6MwlBLqAXS5OKA1cYLHSOM=; b=Y+lNkEsYvtK6rfCRA0ABJ/eOsK8Gll5DiEUc//WMEmJxuImjyqs3NdRDf2uzTnJDcHfrtS rXvMN229ejcCzkZ6GfWZmqKwCS14oHxtcUUfXIhfF+idTCXgS19LAQ3YxLQJ9RKGQbgvoV 6j1o9DiB6Q246A1W3SzMJGzy1/AxtSA= Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-412-QypR8hmuPKmTiM1-qJY70A-1; Sun, 12 Nov 2023 23:04:42 -0500 X-MC-Unique: QypR8hmuPKmTiM1-qJY70A-1 Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-1cc482cc026so54412355ad.2 for ; Sun, 12 Nov 2023 20:04:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699848282; x=1700453082; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tws2IAPG/pAuM74CEbXNr6MwlBLqAXS5OKA1cYLHSOM=; b=dLt27v57lMCHcm4edMHjuO4dpyV0yJkKs0mFNNhoCDiykH2GMPRgqudabCvEU9Li04 cxkH/6MwIVy/goyQeCPuj+eNuFTEXBgDu/kttC2otwk3SdKuXTAbzPZOdztMGGOC00Hy p0dJG2Y1rQhzEixVBU8J00ImOyLVgE87SDC87t2ZgSYFtgguir2AGJyRjwwrnhFG8zEn KRuGSDJUVm1GVFl8XNxkpvcT9J5rTYqLvmeORVJ648Sk8ckQ9Q360f1WB1HzkkPLn0zk q2RVE2+WH6WIhegTT33DZx3uN4HzAnnoeQ1NTWAOyHIMl15zV8LuG8cIyg1OvZoamyfY mB9w== X-Gm-Message-State: AOJu0Ywbq/JcfMV1Ympmq6y5YASCW0ifYVYY4mtmhU3gscje2MnOK6yb p/E/U2dyqwrXT/7JYBjWypTk5zpZY2q9+ECdxgu/wrqtWPI930hRMCygN16IpkalxAOlr0znk/G 9umfXI5QeOajRjaQMTd4cp2GlrH2YvQpQiOs= X-Received: by 2002:a17:902:c40d:b0:1b0:f8:9b2d with SMTP id k13-20020a170902c40d00b001b000f89b2dmr6898998plk.29.1699848281707; Sun, 12 Nov 2023 20:04:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IHYR2VwJDEptBEIbrqjgd8Zx/CSzLVMmBQUVzyl+4ab4Yq5iFKzjqaERsoMDmohw8xGXwqYvw== X-Received: by 2002:a17:902:c40d:b0:1b0:f8:9b2d with SMTP id k13-20020a170902c40d00b001b000f89b2dmr6898988plk.29.1699848281368; Sun, 12 Nov 2023 20:04:41 -0800 (PST) Received: from ?IPV6:2001:8003:e5b0:9f00:b890:3e54:96bb:2a15? ([2001:8003:e5b0:9f00:b890:3e54:96bb:2a15]) by smtp.gmail.com with ESMTPSA id i6-20020a170902eb4600b001c61073b076sm3230467pli.144.2023.11.12.20.04.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Nov 2023 20:04:41 -0800 (PST) Message-ID: <955f2b95-76e4-4e68-830b-e6dd9f122dc1@redhat.com> Date: Mon, 13 Nov 2023 14:04:32 +1000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 11/22] drivers: base: remove unnecessary call to register_cpu_under_node() To: "Russell King (Oracle)" , linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org Cc: Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse , Greg Kroah-Hartman , "Rafael J. Wysocki" References: From: Gavin Shan In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231112_200446_044812_530A8103 X-CRM114-Status: GOOD ( 18.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 11/7/23 20:30, Russell King (Oracle) wrote: > Since "drivers: base: Move cpu_dev_init() after node_dev_init()", we > can remove some redundant code. > > node_dev_init() will walk through the nodes calling register_one_node() > on each. This will trickle down to __register_one_node() which walks > all present CPUs, calling register_cpu_under_node() on each. > > register_cpu_under_node() will call get_cpu_device(cpu) for each, which > will return NULL until the CPU is registered using register_cpu(). This > now happens _after_ node_dev_init(). > > Therefore, calling register_cpu_under_node() from __register_one_node() > becomes a no-op, and can be removed. > > Signed-off-by: Russell King (Oracle) > --- > drivers/base/node.c | 7 ------- > 1 file changed, 7 deletions(-) > __register_one_node() can be called in memory hot add path either. In that path, a new NUMA node can be presented and becomes online. Does this become a problem after the logic of associating CPU with newly added NUMA node? Thanks, Gavin > diff --git a/drivers/base/node.c b/drivers/base/node.c > index 493d533f8375..4d5ac7cf8757 100644 > --- a/drivers/base/node.c > +++ b/drivers/base/node.c > @@ -867,7 +867,6 @@ void register_memory_blocks_under_node(int nid, unsigned long start_pfn, > int __register_one_node(int nid) > { > int error; > - int cpu; > > node_devices[nid] = kzalloc(sizeof(struct node), GFP_KERNEL); > if (!node_devices[nid]) > @@ -875,12 +874,6 @@ int __register_one_node(int nid) > > error = register_node(node_devices[nid], nid); > > - /* link cpu under this node */ > - for_each_present_cpu(cpu) { > - if (cpu_to_node(cpu) == nid) > - register_cpu_under_node(cpu, nid); > - } > - > INIT_LIST_HEAD(&node_devices[nid]->access_list); > node_init_caches(nid); > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel