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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 E95BDC47255 for ; Mon, 11 May 2020 11:26:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AF2162082E for ; Mon, 11 May 2020 11:26:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="HcmtsGhW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF2162082E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 33AA8900032; Mon, 11 May 2020 07:26:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C3F4900006; Mon, 11 May 2020 07:26:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B428900032; Mon, 11 May 2020 07:26:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0046.hostedemail.com [216.40.44.46]) by kanga.kvack.org (Postfix) with ESMTP id F324E900006 for ; Mon, 11 May 2020 07:26:54 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B35522C8B for ; Mon, 11 May 2020 11:26:54 +0000 (UTC) X-FDA: 76804211148.09.wool67_3c3dcac15183c X-HE-Tag: wool67_3c3dcac15183c X-Filterd-Recvd-Size: 3414 Received: from ozlabs.org (ozlabs.org [203.11.71.1]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Mon, 11 May 2020 11:26:53 +0000 (UTC) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 49LJYN0Wgxz9sV6; Mon, 11 May 2020 21:26:48 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1589196409; bh=4NvXf9toL+4UXpT6HxsGqGALQmokSTs3VQyX07XztTk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=HcmtsGhW3vvibCLKVXSur3CJ6fDr8ntOm4mcDszKPhs4GTP737/Wdfw0z6huCxBCe HVcsEEd/MTSe9PIvxR4g1mJyWlY9pNfzuhdWrgSLDvrxv0HoV0uCl81kNTDqjk5Cxc TgCZNgAde0FVNfAZ4JhAxZ7N9PiEsN+zjxPDzb7Rc4uXtU4HmRtqRWhhDdLzWuCB8l GZBwk+W4cMwAKVsgp5G9PAyRFVaBbJ0zWJP9A9TDVJYCcc8SUNVV+6i8c+OlC0UZIZ A+Tdq4kCohHBk3kW2wY1c8d3rP7bLfFFQlHv8A/x1THr3dNj5iLBtWGWEfQ2IcZBQ0 S3FUgyHwBmyow== From: Michael Ellerman To: Srikar Dronamraju , Christopher Lameter Cc: Andrew Morton , linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Hocko , Mel Gorman , Vlastimil Babka , "Kirill A. Shutemov" , Linus Torvalds , Gautham R Shenoy Subject: Re: [PATCH v3 1/3] powerpc/numa: Set numa_node for all possible cpus In-Reply-To: <20200508132130.GC1961@linux.vnet.ibm.com> References: <20200501031128.19584-1-srikar@linux.vnet.ibm.com> <20200501031128.19584-2-srikar@linux.vnet.ibm.com> <20200508132130.GC1961@linux.vnet.ibm.com> Date: Mon, 11 May 2020 21:27:07 +1000 Message-ID: <87v9l2btkk.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Srikar Dronamraju writes: > * Christopher Lameter [2020-05-02 22:55:16]: > >> On Fri, 1 May 2020, Srikar Dronamraju wrote: >> >> > - for_each_present_cpu(cpu) >> > - numa_setup_cpu(cpu); >> > + for_each_possible_cpu(cpu) { >> > + /* >> > + * Powerpc with CONFIG_NUMA always used to have a node 0, >> > + * even if it was memoryless or cpuless. For all cpus that >> > + * are possible but not present, cpu_to_node() would point >> > + * to node 0. To remove a cpuless, memoryless dummy node, >> > + * powerpc need to make sure all possible but not present >> > + * cpu_to_node are set to a proper node. >> > + */ >> > + if (cpu_present(cpu)) >> > + numa_setup_cpu(cpu); >> > + else >> > + set_cpu_numa_node(cpu, first_online_node); >> > + } >> > } >> >> Can this be folded into numa_setup_cpu? >> >> This looks more like numa_setup_cpu needs to change? > > We can fold this into numa_setup_cpu(). > > However till now we were sure that numa_setup_cpu() would be called only for > a present cpu. That assumption will change. > + (non-consequential) an additional check everytime cpu is hotplugged in. > > If Michael Ellerman is okay with the change, I can fold it in. Yes I agree it would be better in numa_setup_cpu(). cheers