Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp53849ybj; Fri, 8 May 2020 06:23:43 -0700 (PDT) X-Google-Smtp-Source: APiQypIXVBjCBAEvl8VjxGPtLZIfbjW4yFCaYInRwYIYSooomZ7BpUYLENMZZpLGCqvs4Bz8lUu6 X-Received: by 2002:aa7:d5d4:: with SMTP id d20mr2191716eds.369.1588944223769; Fri, 08 May 2020 06:23:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588944223; cv=none; d=google.com; s=arc-20160816; b=feVT0bqFc93MO8RRp7D1gb+oXzQa3DRMyoNSYUuCRdZQys8c/KLEf4QVXUZqFNwlzg PE+zS+Q23BC9sQwEZ1A7KkG8bBXqiqPbyVF2YDGhEqCZpGEdmlZZJfFYXjL3x+37AWTH x4ZczTRtVZ2KoJ08CYYOEwJtTM3fulWt4ectH1zPvRsYEgbbbgh3HWkAiwLSAvUDZvlW hPQ9zSYysj6+8a5RurT68jsraQK0NIrlpeqOCF9mBtEMhMntYiZYB/mTuRMMWzEuSIPm ird+DTFBKG47sOOdyemsCOO2EZmA3b3dcJXKlXHrtVLelF66wb5c3wG8l/wgUp7Cz6uM lXpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date; bh=3v0zfimWMrurzpWRs/TDVvPNarWtRy3WAnOR473FZsQ=; b=etU4CjRLePvHQvlqicj2QX5C1b7b3G0NGbTHdCSTQF3QLA2+yEZAkje7Tvxah8rKN1 NT0raGOm3nBgVlz9kxF//h8RUUD8g04oH6Y7FfPNtm5y29mh2j3FdWlt3gMbB/g0di51 u68ICdbgtQdF0+RUprTRlKlzAuoPTRZmzjIcwwJG4VlrTHb0hAkX2NgWY2HNkJw0ga6v v4EZ9hr56yeCp7/4NlPNxnwiqRpDmYGYtRvBnngkGSMShq2jw9LDGDPvC9oi+0JDyiYK PA/jaKGryFiUlpiXLbacQUCMR5ac0xIAkrtjjJ8DwCx+UZu4CZr4S4y/teyjSLfCstKW 1BUw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j5si1009563ejj.183.2020.05.08.06.23.19; Fri, 08 May 2020 06:23:43 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730462AbgEHNV5 (ORCPT + 99 others); Fri, 8 May 2020 09:21:57 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:44832 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729669AbgEHNVz (ORCPT ); Fri, 8 May 2020 09:21:55 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 048D2DV0054976; Fri, 8 May 2020 09:21:38 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 30vtsemp3t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 May 2020 09:21:38 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 048DKffI028238; Fri, 8 May 2020 13:21:35 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04fra.de.ibm.com with ESMTP id 30s0g65exx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 May 2020 13:21:35 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 048DLXTK66716056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 8 May 2020 13:21:33 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 64268A405B; Fri, 8 May 2020 13:21:33 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5854CA4055; Fri, 8 May 2020 13:21:31 +0000 (GMT) Received: from linux.vnet.ibm.com (unknown [9.126.150.29]) by d06av23.portsmouth.uk.ibm.com (Postfix) with SMTP; Fri, 8 May 2020 13:21:31 +0000 (GMT) Date: Fri, 8 May 2020 18:51:30 +0530 From: Srikar Dronamraju To: 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" , Michael Ellerman , Linus Torvalds , Gautham R Shenoy Subject: Re: [PATCH v3 1/3] powerpc/numa: Set numa_node for all possible cpus Message-ID: <20200508132130.GC1961@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20200501031128.19584-1-srikar@linux.vnet.ibm.com> <20200501031128.19584-2-srikar@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.676 definitions=2020-05-08_12:2020-05-08,2020-05-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 bulkscore=0 impostorscore=0 malwarescore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 spamscore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005080111 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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. -- Thanks and Regards Srikar Dronamraju