Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1791685ybk; Mon, 11 May 2020 04:29:38 -0700 (PDT) X-Google-Smtp-Source: APiQypKHyevptkHY+/kdqRe9u9YN2IOCgttr/4lP4DaJaAWjR+DV4fA2ScwMZJXftNuMk+vyyrlv X-Received: by 2002:a17:906:390a:: with SMTP id f10mr12545711eje.74.1589196578472; Mon, 11 May 2020 04:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589196578; cv=none; d=google.com; s=arc-20160816; b=e6T6+G/ltEobiPxXnx9X3eOZyFIwJx5Z9j3z7Z5iM6wdGadZW3dkooqVtX1u6c8Otn yG1laecS96BEzcd8SBXCiOgTMvgJKmFI9vROEYEk/W1p3it5a6dRNX7hzB3DnpJhQ+as NJFHwScHOGuuRFbAkZ6Pbv4HrEOCtJBjDJ8+t3tSiJp93hPuDnCq3EH62ytwrlsc1r9K fLxwe9nnzUCanI2jPD8GkAGkOt/cbWYuVQQG86gLsQMpPc1ttOsXS2IPyHJdEKbR/sWs 7Kr3IijduW9KxYd0lF+JASCOVItzIyec3ZcNmkT5gLCHqSBKcjIXfYEaOWg4P02NjECj BByQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=sKJavxbA0Xvj5S6en7//8isCNrR2zgO40smYU344cOo=; b=ti5Yci+8o6D8cjGT7a2whd8J0E4cyMFSbekQeDdxjyNNZSatLY1O7NsgLhMb8LvXpd 3eRD8yIskCPlzs5gdpqI0t5Wj5vh6rN+i74mv663SBFXJhCZDa2HFptPqCfKuIqMaAyo 1gvkJW2iyn3I4eVkndYQBsewGedtti0ZAtB6kEkL3Pe66az7CArSXtI2aDFUJG+Dxqto mCXRX9e4jbNDMKu3uhAZctxhvdi98Pi8gpCSy+JwCI2cZ4YyCgEKATtU8qhglTwX+0tq ci5YwYALLIgCRTDxETjIb2BlsA6RjpgJiNNjXhuxfO1LgMKs38wIWGBVVBK2dK/g42IU qPgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=HcmtsGhW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si4046121ejg.10.2020.05.11.04.29.15; Mon, 11 May 2020 04:29:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=HcmtsGhW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729956AbgEKL0w (ORCPT + 99 others); Mon, 11 May 2020 07:26:52 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:35281 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728638AbgEKL0u (ORCPT ); Mon, 11 May 2020 07:26:50 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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