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 X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 693C7C433DB for ; Tue, 23 Mar 2021 22:52:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 35AA3619D3 for ; Tue, 23 Mar 2021 22:52:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233878AbhCWWwW (ORCPT ); Tue, 23 Mar 2021 18:52:22 -0400 Received: from mga11.intel.com ([192.55.52.93]:44363 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234056AbhCWWvz (ORCPT ); Tue, 23 Mar 2021 18:51:55 -0400 IronPort-SDR: NnElrSfJ4mwaF0v2TgwEluAe1KJjkp17LrTA77P6lS5zvopDznpFw9+i1xjYVidv+/VowSFJzm 2l26z3+R7zMA== X-IronPort-AV: E=McAfee;i="6000,8403,9932"; a="187267071" X-IronPort-AV: E=Sophos;i="5.81,272,1610438400"; d="scan'208";a="187267071" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 15:51:55 -0700 IronPort-SDR: b3cIenSAHtIFrqMGBdnds/IuZBprUlUsf22giSkWhZFX1rZFMzweJYHNEdVXFSZecVvl1JvoGO rRFiSYJbkKLQ== X-IronPort-AV: E=Sophos;i="5.81,272,1610438400"; d="scan'208";a="607897422" Received: from schen9-mobl.amr.corp.intel.com ([10.255.229.173]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 15:50:50 -0700 Subject: Re: [RFC PATCH v5 4/4] scheduler: Add cluster scheduler level for x86 To: Barry Song , catalin.marinas@arm.com, will@kernel.org, rjw@rjwysocki.net, vincent.guittot@linaro.org, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, lenb@kernel.org, peterz@infradead.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de Cc: msys.mizuma@gmail.com, valentin.schneider@arm.com, gregkh@linuxfoundation.org, jonathan.cameron@huawei.com, juri.lelli@redhat.com, mark.rutland@arm.com, sudeep.holla@arm.com, aubrey.li@linux.intel.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, x86@kernel.org, xuwei5@huawei.com, prime.zeng@hisilicon.com, guodong.xu@linaro.org, yangyicong@huawei.com, liguozhu@hisilicon.com, linuxarm@openeuler.org, hpa@zytor.com References: <20210319041618.14316-1-song.bao.hua@hisilicon.com> <20210319041618.14316-5-song.bao.hua@hisilicon.com> From: Tim Chen Message-ID: <110234d1-22ce-8a9a-eabb-c15ac29a5dcd@linux.intel.com> Date: Tue, 23 Mar 2021 15:50:49 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20210319041618.14316-5-song.bao.hua@hisilicon.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On 3/18/21 9:16 PM, Barry Song wrote: > From: Tim Chen > > There are x86 CPU architectures (e.g. Jacobsville) where L2 cahce > is shared among a cluster of cores instead of being exclusive > to one single core. > > To prevent oversubscription of L2 cache, load should be > balanced between such L2 clusters, especially for tasks with > no shared data. > > Also with cluster scheduling policy where tasks are woken up > in the same L2 cluster, we will benefit from keeping tasks > related to each other and likely sharing data in the same L2 > cluster. > > Add CPU masks of CPUs sharing the L2 cache so we can build such > L2 cluster scheduler domain. > > Signed-off-by: Tim Chen > Signed-off-by: Barry Song Barry, Can you also add this chunk to the patch. Thanks. Tim diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 2a11ccc14fb1..800fa48c9fcd 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -115,6 +115,7 @@ extern unsigned int __max_die_per_package; #ifdef CONFIG_SMP #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)) #define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_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 X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 173D9C433C1 for ; Tue, 23 Mar 2021 22:52:51 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 85C54619D9 for ; Tue, 23 Mar 2021 22:52:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 85C54619D9 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=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AMPxW41dEXjCPWFRSyZsPsJOaHLVnNUg70uAIS6n5EI=; b=ZYFOKbly0nuZSEcZIMvWAwW+M qkJLAYwmXGlveFyj68eq1yLhpUKEi+/owyHSAzVSKkdTOkCczeH8E2u8JW0BMncb5PW+Im357coQl y5vhXy83mYuOEHcZnyY3ZLZtMagJt2RL8cmevtYvb2TM+/PzzWOwCzfCDF4QW/nTxGUrPLqG+Rr9i bmj4nmY+QQqwq54xiKS2cpFuYI4DCq+4kU6fi8vmYLHvutsexmMUGQ205ERLH9Gvm0ajCZvPtKhUx RXN66DKDf3K6fFvM2kO4vYRq6roky4QBvpIpyEsbZSqwrdy/rA8uMqeYY50+GqZvII93gYUx7JHn7 1LZ7gDupw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lOpre-00Fwbg-4v; Tue, 23 Mar 2021 22:51:06 +0000 Received: from mga04.intel.com ([192.55.52.120]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lOprW-00FwaX-KM for linux-arm-kernel@lists.infradead.org; Tue, 23 Mar 2021 22:51:01 +0000 IronPort-SDR: 2w8P8x+SdFzhRuK1o51UX339r3Wga4eAV816L4+8OU4WcB7GcawFcwBY3CeKPiVhB3lxOENq+r zmGUftRx+BPQ== X-IronPort-AV: E=McAfee;i="6000,8403,9932"; a="188263024" X-IronPort-AV: E=Sophos;i="5.81,272,1610438400"; d="scan'208";a="188263024" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 15:50:53 -0700 IronPort-SDR: b3cIenSAHtIFrqMGBdnds/IuZBprUlUsf22giSkWhZFX1rZFMzweJYHNEdVXFSZecVvl1JvoGO rRFiSYJbkKLQ== X-IronPort-AV: E=Sophos;i="5.81,272,1610438400"; d="scan'208";a="607897422" Received: from schen9-mobl.amr.corp.intel.com ([10.255.229.173]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 15:50:50 -0700 Subject: Re: [RFC PATCH v5 4/4] scheduler: Add cluster scheduler level for x86 To: Barry Song , catalin.marinas@arm.com, will@kernel.org, rjw@rjwysocki.net, vincent.guittot@linaro.org, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, lenb@kernel.org, peterz@infradead.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de Cc: msys.mizuma@gmail.com, valentin.schneider@arm.com, gregkh@linuxfoundation.org, jonathan.cameron@huawei.com, juri.lelli@redhat.com, mark.rutland@arm.com, sudeep.holla@arm.com, aubrey.li@linux.intel.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, x86@kernel.org, xuwei5@huawei.com, prime.zeng@hisilicon.com, guodong.xu@linaro.org, yangyicong@huawei.com, liguozhu@hisilicon.com, linuxarm@openeuler.org, hpa@zytor.com References: <20210319041618.14316-1-song.bao.hua@hisilicon.com> <20210319041618.14316-5-song.bao.hua@hisilicon.com> From: Tim Chen Message-ID: <110234d1-22ce-8a9a-eabb-c15ac29a5dcd@linux.intel.com> Date: Tue, 23 Mar 2021 15:50:49 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20210319041618.14316-5-song.bao.hua@hisilicon.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210323_225100_231961_0A59307D X-CRM114-Status: GOOD ( 13.95 ) 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 3/18/21 9:16 PM, Barry Song wrote: > From: Tim Chen > > There are x86 CPU architectures (e.g. Jacobsville) where L2 cahce > is shared among a cluster of cores instead of being exclusive > to one single core. > > To prevent oversubscription of L2 cache, load should be > balanced between such L2 clusters, especially for tasks with > no shared data. > > Also with cluster scheduling policy where tasks are woken up > in the same L2 cluster, we will benefit from keeping tasks > related to each other and likely sharing data in the same L2 > cluster. > > Add CPU masks of CPUs sharing the L2 cache so we can build such > L2 cluster scheduler domain. > > Signed-off-by: Tim Chen > Signed-off-by: Barry Song Barry, Can you also add this chunk to the patch. Thanks. Tim diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 2a11ccc14fb1..800fa48c9fcd 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -115,6 +115,7 @@ extern unsigned int __max_die_per_package; #ifdef CONFIG_SMP #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)) #define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel