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 28400C433EF for ; Mon, 4 Oct 2021 22:54:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E79BA61501 for ; Mon, 4 Oct 2021 22:54:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236908AbhJDW4l (ORCPT ); Mon, 4 Oct 2021 18:56:41 -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-acpi@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)) 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 59CF8C433F5 for ; Mon, 4 Oct 2021 22:57:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 194EF6140A for ; Mon, 4 Oct 2021 22:57:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 194EF6140A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:Cc:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6VSd2eLAgdulXAhzZ2ulTlJjb2E64EPYckbQNyVFyaY=; b=ItBxunNUWRZ6nc aJi9lJpwMT3m26IqtrVfKHEocpqxuDK+6RnkgJqF/cLdEL2pJnJKffBpzTK1KwBFnxWyohKhS/QMg bQF2i4do2AAChaSc992HQRtFi8o0tZL6wJxVguiE9Q2T/CDWsT7zjlTxHfpQwxwjTtJw/UqnR16PN vxQoDwnSVCwKW2hC+UCLNInTv44PhxH5/bM0HVI8aXbpi+Szz9en8sYHn+kmttSXYxAoJgRsFQf5i M/lkiYrd2lCIkvpt963/nBh1L0kH0N5eNhrxt9RMsTDG14slAVYFbp53eepV2LfoVDX5HVDxkWFVy vWBBY3kQl1RKHHA+c21Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXWrI-008MHD-Ed; Mon, 04 Oct 2021 22:54:56 +0000 Received: from mga17.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXWrF-008MGQ-1W for linux-arm-kernel@lists.infradead.org; Mon, 04 Oct 2021 22:54:54 +0000 X-IronPort-AV: E=McAfee;i="6200,9189,10127"; a="206423268" X-IronPort-AV: E=Sophos;i="5.85,347,1624345200"; d="scan'208";a="206423268" 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> User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211004_155453_150801_3C98131C X-CRM114-Status: GOOD ( 21.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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)) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel