Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6624166ybi; Wed, 29 May 2019 10:26:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhWFylcOf9rjw4N7GG7o3WrNwUz+uSdaqUmB+n4Zhfm2w8KnyA+JNXYt9bklO0OITXCy7E X-Received: by 2002:a17:902:b492:: with SMTP id y18mr134784529plr.96.1559150774123; Wed, 29 May 2019 10:26:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559150774; cv=none; d=google.com; s=arc-20160816; b=XQTNGYq/qMm6UefH/bY8VM5/wyfC38S/hWr7AU+fjbxy/NqlRsroLmGVy0MFh/hZmC 6F4j/yCpQMnRjrLxdi0WEoGOz3gZ+aKPYB+SMOEc5ys8pV7MUf8yPZDHirqgDsemP5Rc jxo9G3Hx7xkHAlPEx8A7r1irJ8OLL/Qc8Z6tWBKcVD+KbqvRMmlaK4BFR42QVbavs/rO U+geAg3AAlOcT8sv4Uoy7TtLdnZ95z9EsFKS7PkcIIkE96IjG16oGSdOHP4o0/HAxMJ0 j6UzxzsfBtba09zkU+aeivE/SIYPcAtHgot1nPgpEG1wkewphE4AqycdGMchdn2MPtMp 6J6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr :dkim-signature; bh=8UZLS3X60oDnBZPwlrF8xvFzi8WETKGCkYYBDOQTH2w=; b=l/SGMSwNLB0495cBhF1EGGUzvO0q2T/om7mzzPMQugTtLAwVnXIib2BP6By+8NCAbR lPMhpeGZCaiYM/kUtkiiHJewc2Mw9YJ21MbKs0mAqHFj9cev7r+i8iko0TKwtYKrcrDc cGSIChiFpt9SpJW9mjiEx5TjOpDsgvlsKcs9VYq3YVlCROvXPqz+W2FZCnR6l2hXavxJ 1yWtcX7pQdFi73/YyGx//EM213tK+xz1NuC2Teu8fhbbfSWjC0g17teLzdcgszDRZYJ5 +nEjW25oKcy1fnzbaaHyh/YiOlIzH62YonRyOIIs6Uy8hugy335NsuOsZH6+eePnn8MD 6uZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=r1zdFY4M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si252478plt.202.2019.05.29.10.25.57; Wed, 29 May 2019 10:26:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=r1zdFY4M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726828AbfE2RYq (ORCPT + 99 others); Wed, 29 May 2019 13:24:46 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:33354 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbfE2RYq (ORCPT ); Wed, 29 May 2019 13:24:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1559150750; x=1590686750; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=GmwkQjsql+93mksfGBKpKv07dJD3LbLgm/uiMZ0AHPo=; b=r1zdFY4MJ6Ewx3vjpjXzAAU7/hxykRnalg5HAAfOCkjQzup0PvIsw4qO +/RDxKI2Wjogcbrl/JQtJ/5BwoYR1EL9aQ1/Sr1fZx4hi4zQ8aycEjZMf wGSsRuN7PSn/qtXaHmRxtN8K49HgHHX4oBnxliP57k8s9io2rX8z5BYJG c47dsRXCzmEPqK77Wx+stCAZKULECyFOLgPN8Vkbr2k/HHNAx4LCLCyj7 t43MJWPNqDqqv4jKnouQrSe4evjkeAfsrpgvwUvUrBr8trmLlHMIUb3bl D7lSbP5vmDQ1n8bW65sSIvSvyEwz3b+fTZ3tQMC4PCDL9P+KUEBSfkWf7 A==; X-IronPort-AV: E=Sophos;i="5.60,527,1549900800"; d="scan'208";a="208888300" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2019 01:25:50 +0800 IronPort-SDR: qJjPorv7NLTsDipQ/quAsdkOhmgOQxd3GEQHDCrxv2fjccRPwl2BvfzQ1r/vsIkVi57XGY1iiA IsajZazzTKIXLeHAwBQppRCnbM9TGtPNZ5ntWL+8XMyuRxTtDZowYzbaNI7x6hPlTwf0BVevwT 88OVgkwuR6SDXq7MQpx8RZWUS0iX1qKywgtouiVnSj7kAHPHfF5V3kKY+jjsGk0Uydqv3KU0kj uTWaroTTL1UNAqf2V+nGLr6oH8P05zuSC4jPtRFPcXNx/rih1uv/e5uAc/WYkzfF50Ey/XBOGW xsMY6vG/gCghuchMvWHONml5 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 29 May 2019 09:59:56 -0700 IronPort-SDR: qwx1yS5ZHNt0FCMSYqf+WJKfwEZzDe1m1COXuHEaXSEA1gbjcAghTgoZA/pAPmiHYjRRuhMwaS 4YU0yZuBBWOR8HMPPKVU5iZV0wOR6jpU6gpjoSofyjnMX+Yj+CLJ54VyieeJDHrICAWbFkwZEE 8fiPHmX0AWUyXp5ROGUHIaH1uox4cxYmupRrmw0K0LfN1+pPMJXpEiN7/T4ppYloUEVMdUMMYe 0f9cT1yfCL6ZBGsZeJTclAy1epn3qLfhy4lQ1mzKbXDz2qH6YA/AnqpC7lGAh68rWc2HbLUYqk pt8= Received: from r6220.sdcorp.global.sandisk.com (HELO [192.168.1.6]) ([10.196.157.143]) by uls-op-cesaip02.wdc.com with ESMTP; 29 May 2019 10:24:46 -0700 Subject: Re: [RFT PATCH v5 3/5] cpu-topology: Move cpu topology code to common code. To: Sudeep Holla , Jeffrey Hugo Cc: "linux-kernel@vger.kernel.org" , Albert Ou , Andreas Schwab , Anup Patel , Catalin Marinas , "devicetree@vger.kernel.org" , Greg Kroah-Hartman , Ingo Molnar , Jeremy Linton , "linux-riscv@lists.infradead.org" , Mark Rutland , Morten Rasmussen , Otto Sabart , Palmer Dabbelt , Paul Walmsley , "Peter Zijlstra (Intel)" , "Rafael J. Wysocki" , Rob Herring , Thomas Gleixner , Will Deacon , "linux-arm-kernel@lists.infradead.org" References: <20190524000653.13005-1-atish.patra@wdc.com> <20190524000653.13005-4-atish.patra@wdc.com> <20190529104801.GA13155@e107155-lin> From: Atish Patra Message-ID: Date: Wed, 29 May 2019 10:24:44 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190529104801.GA13155@e107155-lin> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/29/19 3:48 AM, Sudeep Holla wrote: > On Thu, May 23, 2019 at 05:06:50PM -0700, Atish Patra wrote: >> Both RISC-V & ARM64 are using cpu-map device tree to describe >> their cpu topology. It's better to move the relevant code to >> a common place instead of duplicate code. >> > > I couldn't test this on any ARM64 server platforms, tested on Juno > and other embedded platforms. > Jeff had tested earlier patch series on ARM64 server platform. Since then, the series has changed. Even though, I don't expect it break ARM64, if it can be verified again that would be great. @Jeff: Can you give it a shot if you have some time ? > Tested-by: Sudeep Holla > Reviewed-by: Sudeep Holla > Thanks! >> Signed-off-by: Atish Patra >> Tested-by: Jeffrey Hugo >> --- >> arch/arm64/include/asm/topology.h | 23 --- >> arch/arm64/kernel/topology.c | 303 +----------------------------- >> drivers/base/arch_topology.c | 296 +++++++++++++++++++++++++++++ >> include/linux/arch_topology.h | 28 +++ >> include/linux/topology.h | 1 + >> 5 files changed, 329 insertions(+), 322 deletions(-) >> > > [...] > >> diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c >> index 0825c4a856e3..6b95c91e7d67 100644 >> --- a/arch/arm64/kernel/topology.c >> +++ b/arch/arm64/kernel/topology.c >> > > [...] > >> -static int __init parse_cluster(struct device_node *cluster, int depth) >> -{ >> - char name[10]; >> - bool leaf = true; >> - bool has_cores = false; >> - struct device_node *c; >> - static int package_id __initdata; >> - int core_id = 0; > > [Ultra minor nit]: you seem to have reordered the above declaration when > you moved, just noticed as it showed up when comparing. > Arrgh. Sorry! I think I was trying to fix a checkpatch or something and forgot to revert. I will update it. >> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c >> index 1739d7e1952a..20a960131bee 100644 >> --- a/drivers/base/arch_topology.c >> +++ b/drivers/base/arch_topology.c > > [...] > >> + >> +static int __init parse_cluster(struct device_node *cluster, int depth) >> +{ >> + char name[10]; >> + bool leaf = true; >> + bool has_cores = false; >> + int core_id = 0; >> + static int package_id __initdata; >> + struct device_node *c; >> + int i, ret; >> + > > [...] > >> +#if defined(CONFIG_ARM64) || defined(CONFIG_RISCV) >> +void update_siblings_masks(unsigned int cpu); >> +#endif >> +void remove_cpu_topology(unsigned int cpuid); >> + > > Another thing(not a block and we can do it once this is merged) is to > remove these #ifdefs > This #ifdef is removed in patch 4. But we should remove the other ones around init_cpu_topology, parse_dt_topology and friends in a follow up patch once this is merged. > -- > Regards, > Sudeep > -- Regards, Atish