Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1504842ybb; Thu, 9 Apr 2020 03:33:05 -0700 (PDT) X-Google-Smtp-Source: APiQypKiSypyQqL1WxaB1Pv/94xzF+JTnplVOoNjvEYNIhyx7QBPwS7RMwvKLRIlQKAqtFngD7V2 X-Received: by 2002:a9d:7402:: with SMTP id n2mr3370593otk.262.1586428385569; Thu, 09 Apr 2020 03:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586428385; cv=none; d=google.com; s=arc-20160816; b=xy+7TAGDRc8+Xe86LDg0l2hgVYMmfi2NMsBe3qrvREitF2DKLMmJ6SfhbRzUzXu3MU SowGLkQhZyIjjm8XxJRyeHOcQmhpPgttBYUfotbpWN4bQvpzZY1Jjg4hQq5goNaErT8e /32i+Vz5gxTK7IFL97RjrqPX1jH5kikLe9gKa5ucatIhrYll2zZin9LQAtvG4nYbw3PS NHQeElBq8jf2rzB8iKPTywBHkkTVvihBGLT0Y+eaKe8Lk11mt7jmy8LotXbfB+9EBoIE dTEaqO5KMAWFmf+A/UuqCdxTIoeDPGCblJsOpCsPzY+dIpsBBwuGSg42Vk0iBNB7gkHt rSgw== 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:message-id:subject:cc :to:from:date; bh=CjBKKTQE1zzoZMIFF6EL5i+LFcHw5MvEwZmYEsuDnwc=; b=wvqtA3+8L/cCBlCZqJ6lIm10Qd7J6Wd3/0AWly2f7bZhz6OY7MBGKmiXlL3nYLtETG nAnXEciZS31tbvvKkxG20Ppbg2kFbcOCNQ7aEczofJCtGiiSeHe3mRGVLr6eOdiXoGj/ XoOBzTQF7JmEQcaU63Q+1SkzEZUjF9gqnb3IDXYMO3TX9XNTYt+NbdvLJLhy90z6WHhw jNbFlzoWR8exmk+sCmO4opI1ZAVyteRnFjud5ou33KgMY5WGjd8wdaxXk3vKS2swvFZ+ 1+FpdFzDIeXTr2kQUbhVxMJ1ZyvC3HsN/1nI8a+cyWa701wfz6W/Umn5q1nueVi4UtjT P27g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j15si3737881ots.187.2020.04.09.03.32.50; Thu, 09 Apr 2020 03:33:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726671AbgDIKbe (ORCPT + 99 others); Thu, 9 Apr 2020 06:31:34 -0400 Received: from foss.arm.com ([217.140.110.172]:48268 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725970AbgDIKbd (ORCPT ); Thu, 9 Apr 2020 06:31:33 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A694031B; Thu, 9 Apr 2020 03:31:33 -0700 (PDT) Received: from bogus (unknown [10.37.12.63]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6D8893F73D; Thu, 9 Apr 2020 03:31:24 -0700 (PDT) Date: Thu, 9 Apr 2020 11:31:21 +0100 From: Sudeep Holla To: Jiaxun Yang Cc: linux-mips@vger.kernel.org, Thomas Bogendoerfer , Huacai Chen , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Florian Fainelli , Robert Richter , Greg Kroah-Hartman , "Rafael J. Wysocki" , Thomas Gleixner , Jason Cooper , Marc Zyngier , Paul Burton , Allison Randal , Enrico Weigelt , Kate Stewart , Vladimir Kondratiev , Richard Fontana , Paul Cercueil , Zhou Yanjie , =?utf-8?B?5ZGo55Cw5p2wIChaaG91IFlhbmppZSk=?= , YunQiang Su , Arnd Bergmann , Serge Semin , Matt Redfearn , Steve Winslow , Alexios Zavras , Peter Xu , afzal mohammed , Kamal Dasu , Mike Rapoport , Oleksij Rempel , Sudeep Holla , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, oprofile-list@lists.sf.net Subject: Re: [PATCH 05/12] MIPS: Switch to arch_topology Message-ID: <20200409103121.GD25948@bogus> References: <20200408113505.2528103-1-jiaxun.yang@flygoat.com> <20200408113505.2528103-6-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200408113505.2528103-6-jiaxun.yang@flygoat.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 08, 2020 at 07:34:15PM +0800, Jiaxun Yang wrote: > Previously, MIPS is using self-defined "globalnumber" in struct > mips_cpuinfo to store topology information. However, it's not friendly > to DeviceTree based systems and lack of cpu_capacity related feature > which can take advantage of multi-cluster system. > > Here, we enabled arch_topology for MIPS and adapted some functions > to fit arch_topology structure. > Also, we implmented smp_store_cpu_info to probe CPU's topology information > by "globalnumber" registers in VP ASE or Ebase.CPUNum for legacy systems. > > Signed-off-by: Jiaxun Yang > --- > arch/mips/Kconfig | 1 + > arch/mips/include/asm/cpu-info.h | 49 ---------------------------- > arch/mips/include/asm/smp.h | 2 -- > arch/mips/include/asm/topology.h | 48 +++++++++++++++++++++++++--- > arch/mips/kernel/cpu-probe.c | 43 ------------------------- > arch/mips/kernel/setup.c | 1 + > arch/mips/kernel/smp.c | 55 ++++---------------------------- > arch/mips/kernel/topology.c | 42 ++++++++++++++++++++++++ > 8 files changed, 93 insertions(+), 148 deletions(-) > [...] > diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c > index 8a418783a6bb..b9fefc5dc702 100644 > --- a/arch/mips/kernel/setup.c > +++ b/arch/mips/kernel/setup.c > @@ -784,6 +784,7 @@ void __init setup_arch(char **cmdline_p) > dmi_setup(); > > resource_init(); > + init_cpu_topology(); > plat_smp_setup(); > Continuing my reply on previous patch, I see possible_cpu_mask being set up in plat_smp_setup. Why not reverse the order above. Further I see that the logical->physical CPU mapping is done in plat_smp_setup which is required to store/save any topology information. -- Regards, Sudeep