Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp314870ybh; Wed, 22 Jul 2020 01:05:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeMzCJ1YeqNrtXhNUMHksmbUjmHTHTWr3CGkZlSUrPOXwGSR/9wmcPojaxlnmFv96L9zA0 X-Received: by 2002:a17:906:a242:: with SMTP id bi2mr28070293ejb.243.1595405134005; Wed, 22 Jul 2020 01:05:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595405133; cv=none; d=google.com; s=arc-20160816; b=YadOtpuhIUy9Dprk/18yx3rIW9ZGn6wy6W3H5hxEgNRYBK7//5Urr2R9pDEzbOYn6O N88RK4bRIGl6lscXCA1ELA0Dq+Oez+koTGGGT30F4b/opVkpp9guRGrnuxiYcgQya0eJ vboO8AVKh4pLsV28tXMzYh+on9TXedZOQH1ehlSQcGRcSeO5SP/xKzFtmnSBsJL9kl3a ENovpGtPlmqF2yDBWutwly9cVlAKHBVIrhGw3cHrizaKpa/e6RvT00AEplktYMhDgFTG 29479yMWd8YAYZiifLkW8OusSleRFiXxpB45U+eymzBmFeI01WZwDgTz0VGGTYC/q22m RJIQ== 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=WLpVh7RMrXwitlCoa+yAXLfF0hSB8ufQrrFaeJTqoWQ=; b=ncI7wa53jANh7ZhWPdy0WM7YaCa1FtG6JVAapkR7R99Zh2GYUGR/flXoh/mdK+rfqW IN3yW2aAi6uAAph2HadEjZQLHzruGkt2RpjaCjU73If+yWbLxgXnBC1zp/389z/9LIcb BUTeuUJFbx5G1w7HVG0pTcFP/mCPeTDtpnj9BdzwONOB3jPUAwwkLg4FVUCip9/xpj2j kh0LqFYavXYc7Bvi0/BbbiwaBWApxEEQMsr4d852DguS7WF1kycWSlfiafGwRxi6lcjS 6cGQLmVyJ2TCs8Z8Sc/P2l6VuU72+txtWJSHgzLIFhjV0HvTaLOzLIxhDpc6szzTdvO8 ngLA== 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 bf17si13325969edb.78.2020.07.22.01.05.11; Wed, 22 Jul 2020 01:05:33 -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 S1727882AbgGVIEr (ORCPT + 99 others); Wed, 22 Jul 2020 04:04:47 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:10154 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726573AbgGVIEp (ORCPT ); Wed, 22 Jul 2020 04:04:45 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06M81vrQ126301; Wed, 22 Jul 2020 04:04:35 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 32e1vrhkec-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jul 2020 04:04:35 -0400 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06M83NBe131922; Wed, 22 Jul 2020 04:04:34 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 32e1vrhkdc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jul 2020 04:04:34 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06M80bY1013216; Wed, 22 Jul 2020 08:04:32 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma04ams.nl.ibm.com with ESMTP id 32brq84s82-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jul 2020 08:04:32 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06M84Skv32506278 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Jul 2020 08:04:28 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0276D11C05B; Wed, 22 Jul 2020 08:04:28 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 67F8511C050; Wed, 22 Jul 2020 08:04:25 +0000 (GMT) Received: from linux.vnet.ibm.com (unknown [9.126.150.29]) by d06av25.portsmouth.uk.ibm.com (Postfix) with SMTP; Wed, 22 Jul 2020 08:04:25 +0000 (GMT) Date: Wed, 22 Jul 2020 13:34:24 +0530 From: Srikar Dronamraju To: Michael Ellerman Cc: linuxppc-dev , LKML , Ingo Molnar , Peter Zijlstra , Valentin Schneider , Nick Piggin , Oliver OHalloran , Nathan Lynch , Michael Neuling , Anton Blanchard , Gautham R Shenoy , Vaidyanathan Srinivasan , Jordan Niethe Subject: Re: [PATCH v2 01/10] powerpc/smp: Cache node for reuse Message-ID: <20200722080424.GF9290@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20200721113814.32284-1-srikar@linux.vnet.ibm.com> <20200721113814.32284-2-srikar@linux.vnet.ibm.com> <87imegq9my.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <87imegq9my.fsf@mpe.ellerman.id.au> 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.235,18.0.687 definitions=2020-07-22_03:2020-07-22,2020-07-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 priorityscore=1501 adultscore=0 mlxscore=0 impostorscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007220056 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Michael Ellerman [2020-07-22 17:41:41]: > Srikar Dronamraju writes: > > While cpu_to_node is inline function with access to per_cpu variable. > > However when using repeatedly, it may be cleaner to cache it in a local > > variable. > > It's not clear what "cleaner" is supposed to mean. Are you saying it > makes the source clearer, or the generated code? > > I'm not sure it will make any difference to the latter. I meant the source code, I am okay dropping the hunks that try to cache cpu_to_node. > > > Also fix a build error in a some weird config. > > "error: _numa_cpu_lookup_table_ undeclared" > > Separate patch please. Okay, will do. > > > No functional change > > The ifdef change means that's not true. Okay > > @@ -854,20 +854,24 @@ void __init smp_prepare_cpus(unsigned int max_cpus) > > cpu_callin_map[boot_cpuid] = 1; > > > > for_each_possible_cpu(cpu) { > > + int node = cpu_to_node(cpu); > > + > > Does cpu_to_node() even work here? Except in the case where NUMA is not enabled, (when cpu_to_node would return -1), It should work here since numa initialization would have happened by now. It cpu_to_node(cpu) should work once numa_setup_cpu() / map_cpu_to_node() gets called. And those are being called before this. > > Doesn't look like it to me. > > More fallout from 8c272261194d ("powerpc/numa: Enable USE_PERCPU_NUMA_NODE_ID") ? > > > } > > > > /* Init the cpumasks so the boot CPU is related to itself */ -- Thanks and Regards Srikar Dronamraju