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=-13.8 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,SPF_HELO_NONE,SPF_PASS 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 A923BC433DB for ; Wed, 31 Mar 2021 10:09:33 +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 22D2761962 for ; Wed, 31 Mar 2021 10:09:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22D2761962 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=hisilicon.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:MIME-Version:References:Message-ID:Date:Subject:CC: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Owner; bh=nN8ygamTLZZuWzUVnWhA1PDpZQxuHQ8RVuYJzyiplbI=; b=eqOo8CAAspb8RJGN0moV11Yxg b3PYPjiXS9O9TM+2aGoqbeyssjlHB3mSVNc6BcJdu9dufdtxw8MVTqaevcYNBOu3lXuttM++jQ2vf bQpG9jdtdD1bVEF8ZCGxuA4rRCI9a7vjCSdpRLFexgmGUPGjT6+x9HBwDCRWWsv8Gw/w+1d940iGl N2vGlJasWIaSFWCsaesiaOTot3s7fG6ctny9ZMOlx+/gIY/+swiscdj3WFytC4AoCtEPPE8AX12Ou Viczdhzkv0UMCRX3g/eQm1m3iLyifyS7tvSvctysaDE/XNS/8Xh13xlpcNuGv2S/CImxgeltUuNLZ FrdE5G9vw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRXlJ-006Dbk-19; Wed, 31 Mar 2021 10:07:45 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRXlC-006DZa-9i for linux-arm-kernel@lists.infradead.org; Wed, 31 Mar 2021 10:07:41 +0000 Received: from fraeml709-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4F9MFq5Xxcz685P0; Wed, 31 Mar 2021 17:58:23 +0800 (CST) Received: from lhreml711-chm.china.huawei.com (10.201.108.62) by fraeml709-chm.china.huawei.com (10.206.15.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 31 Mar 2021 12:07:31 +0200 Received: from dggemi761-chm.china.huawei.com (10.1.198.147) by lhreml711-chm.china.huawei.com (10.201.108.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2106.2; Wed, 31 Mar 2021 11:07:30 +0100 Received: from dggemi761-chm.china.huawei.com ([10.9.49.202]) by dggemi761-chm.china.huawei.com ([10.9.49.202]) with mapi id 15.01.2106.013; Wed, 31 Mar 2021 18:07:28 +0800 From: "Song Bao Hua (Barry Song)" To: Tim Chen , "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 , "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" , "xuwei (O)" , "Zengtao (B)" , "guodong.xu@linaro.org" , yangyicong , "Liguozhu (Kenneth)" , "linuxarm@openeuler.org" , "hpa@zytor.com" Subject: RE: [RFC PATCH v5 4/4] scheduler: Add cluster scheduler level for x86 Thread-Topic: [RFC PATCH v5 4/4] scheduler: Add cluster scheduler level for x86 Thread-Index: AQHXHHecEK2PZNeGJ0y0ASUDVCEuNqqRruSAgACLbJCAC7WRgA== Date: Wed, 31 Mar 2021 10:07:28 +0000 Message-ID: <3888ad9a9b3e49feb4767452ebcdacdd@hisilicon.com> References: <20210319041618.14316-1-song.bao.hua@hisilicon.com> <20210319041618.14316-5-song.bao.hua@hisilicon.com> <110234d1-22ce-8a9a-eabb-c15ac29a5dcd@linux.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.126.202.63] MIME-Version: 1.0 X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210331_110738_579130_813D76DD X-CRM114-Status: GOOD ( 22.02 ) 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 > -----Original Message----- > From: Song Bao Hua (Barry Song) > Sent: Wednesday, March 24, 2021 12:15 PM > To: 'Tim Chen' ; 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 ; > 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; > xuwei (O) ; Zengtao (B) ; > guodong.xu@linaro.org; yangyicong ; Liguozhu (Kenneth) > ; linuxarm@openeuler.org; hpa@zytor.com > Subject: RE: [RFC PATCH v5 4/4] scheduler: Add cluster scheduler level for x86 > > > > > -----Original Message----- > > From: Tim Chen [mailto:tim.c.chen@linux.intel.com] > > Sent: Wednesday, March 24, 2021 11:51 AM > > To: Song Bao Hua (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 ; > > 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; > > xuwei (O) ; Zengtao (B) ; > > guodong.xu@linaro.org; yangyicong ; Liguozhu > (Kenneth) > > ; linuxarm@openeuler.org; hpa@zytor.com > > Subject: Re: [RFC PATCH v5 4/4] scheduler: Add cluster scheduler level for > x86 > > > > > > > > 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. > > Sure, Tim, Thanks. I'll put that into patch 4/4 in v6. Hi Tim, You might want to take a look at this qemu patchset: https://lore.kernel.org/qemu-devel/20210331095343.12172-1-wangyanan55@huawei.com/T/#t someone is trying to leverage this cluster topology to improve KVM virtual machines performance. > > > > > 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)) > > > Thanks Barry _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel