From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E115C433FE for ; Mon, 4 Oct 2021 22:54:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 53F6461501 for ; Mon, 4 Oct 2021 22:54:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236947AbhJDW4m (ORCPT ); Mon, 4 Oct 2021 18:56:42 -0400 Received: from mga17.intel.com ([192.55.52.151]:46069 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233501AbhJDW4k (ORCPT ); Mon, 4 Oct 2021 18:56:40 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10127"; a="206423269" X-IronPort-AV: E=Sophos;i="5.85,347,1624345200"; d="scan'208";a="206423269" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2021 15:54:51 -0700 X-IronPort-AV: E=Sophos;i="5.85,347,1624345200"; d="scan'208";a="477402850" Received: from schen9-mobl.amr.corp.intel.com ([10.209.66.53]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2021 15:54:50 -0700 Message-ID: <3a0f95cf5602e11fde0e21032e52aad6e137d940.camel@linux.intel.com> Subject: Re: [PATCH RESEND 0/3] Represent cluster topology and enable load balance between clusters From: Tim Chen To: Barry Song <21cnbao@gmail.com> Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , LKML , Ingo Molnar , Aubrey Li , Borislav Petkov , Daniel Bristot de Oliveira , Ben Segall , Catalin Marinas , Greg Kroah-Hartman , Guodong Xu , "H. Peter Anvin" , Jonathan Cameron , Juri Lelli , "Cc: Len Brown" , ACPI Devel Maling List , LAK , Linuxarm , Mark Rutland , Mel Gorman , msys.mizuma@gmail.com, "Zengtao (B)" , "Rafael J. Wysocki" , Steven Rostedt , Barry Song , Sudeep Holla , Thomas Gleixner , "Rafael J. Wysocki" , Valentin Schneider , Will Deacon , x86 , yangyicong Date: Mon, 04 Oct 2021 15:54:50 -0700 In-Reply-To: References: <20210924085104.44806-1-21cnbao@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2021-10-02 at 20:09 +1300, Barry Song wrote: > > > Thanks, Tim, for your comments. > I am ok to make it default "Y" for x86 after having a better doc as > below: > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index bd27b1cdac34..940eb1fe0abb 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -1002,12 +1002,17 @@ config NR_CPUS > to the kernel image. > > config SCHED_CLUSTER > - bool "Cluster scheduler support" > - default n > + def_bool y > + prompt "Cluster scheduler support" > help > Cluster scheduler support improves the CPU scheduler's > decision > - making when dealing with machines that have clusters of CPUs > - sharing L2 cache. If unsure say N here. > + making when dealing with machines that have clusters of > CPUs. > + Cluster usually means a couple of CPUs which are placed > closely > + by sharing mid-level caches, last-level cache tags or > internal > + busses. For example, on x86 Jacobsville, each 4 CPUs share > one > + L2 cache. This feature isn't a universal win because it can > bring > + a cost of slightly increased overhead in some places. If > unsure > + say N here. > > This also aligns well with SCHED_MC and SCHED_SMT in > arch/x86/kconfig: > config SCHED_MC > def_bool y > prompt "Multi-core scheduler support" > > config SCHED_SMT > def_bool y if SMP > > But ARM64 is running in a different tradition, arch/arm64/Kconfig has > SCHED_MC and SCHED_SMT as below: > config SCHED_MC > bool "Multi-core scheduler support" > help > ... > > config SCHED_SMT > bool "SMT scheduler support" > help > ... > > Barry, Found one minor fix to the x86 patch to take care of compile error for !CONFIG_SMP. Thanks. Tim diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 2548d824f103..cc164777e661 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -109,12 +109,12 @@ extern const struct cpumask *cpu_clustergroup_mask(int cpu); #define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id) #define topology_logical_die_id(cpu) (cpu_data(cpu).logical_die_id) #define topology_die_id(cpu) (cpu_data(cpu).cpu_die_id) -#define topology_cluster_id(cpu) (per_cpu(cpu_l2c_id, cpu)) #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id) extern unsigned int __max_die_per_package; #ifdef CONFIG_SMP +#define topology_cluster_id(cpu) (per_cpu(cpu_l2c_id, cpu)) #define topology_die_cpumask(cpu) (per_cpu(cpu_die_map, cpu)) #define topology_cluster_cpumask(cpu) (cpu_clustergroup_mask(cpu)) #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))