Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp877726ybg; Tue, 28 Jul 2020 23:22:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYBvXfmlaOxSau1BgoujUIxOhxjyVBv2+9a01mwqNdo6BsOQ+oEAdRtZy4RWK3ZY2Fl7n2 X-Received: by 2002:a17:907:42a0:: with SMTP id ny24mr22059404ejb.328.1596003722371; Tue, 28 Jul 2020 23:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596003722; cv=none; d=google.com; s=arc-20160816; b=UluCWS71WsKzkJm/8zYLr3jjI3ZYDVvvY2+iQUVWxYnKZEDeqDkNdpvRL3/DQiNuVB IGosLTOYkFnwRxVreejJPOHjydgy0yMofBYrzlf/L+69JDI625BbcwLIRRz7MBOCGFr7 WlqrnbVOepzr9wotF4208mADUZ8lIOBWI16SkbssaqsyAWJYJtdHCvj5/hXG4QTqxpJV VIMbXOaHdAllYUXnm/Xvb8kfxsDIonjtsBYjCedIe1+aX4bHyVJ6uEMDsN0h4k1MoPL4 MVReN/3TvGFBqw1JZHCoTSiBsY+UD9Xqq/nYKuQcOnFDkxSRrFx1zzSQFfHW8+Nq82Fl ZQmA== 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:reply-to:message-id :subject:cc:to:from:date; bh=Tu9DND8VCAqpPKYmDky1CVcLlQ+BvhvO7qhhYmOrTvc=; b=C+zYTzhkPwvrsLCr9/oIpVM309bMcZZkukyUFk4HRwbpmI8cE5oyyZwq0zamT0SB6d puYkj9Q3iE5TvKjcbtPrdUcxgJlPYB2a4IyQlGzJLSsHj0+Ch2uUS7JkUpk1MOYeOos5 9zzsyBX/KJJEo6e/XOMxEp7haSK5ylJvD1W4A7NpPa0uaQz9iceskrCrRv7/wLZrYB0Z BR4Gw46VsqwKb1HQ6hIP7rfXmuYFnKRfIlfHMA3x+RUs3vdPs2PldJFSkZXsTjxMsVZf DLJ3Av4eJ2ECIExVZTI41cwyPr0f3bXoz84/RRu1AF2WZ+LJ2ecwbvE+7zx5QxbVoQ36 /Khw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si430988ejj.711.2020.07.28.23.21.39; Tue, 28 Jul 2020 23:22:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726832AbgG2GVC (ORCPT + 99 others); Wed, 29 Jul 2020 02:21:02 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:6700 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726367AbgG2GVB (ORCPT ); Wed, 29 Jul 2020 02:21:01 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06T62BJk021360; Wed, 29 Jul 2020 02:20:43 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 32jp1me30v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Jul 2020 02:20:42 -0400 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06T629Hs021130; Wed, 29 Jul 2020 02:20:42 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 32jp1me302-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Jul 2020 02:20:42 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06T69pK2007761; Wed, 29 Jul 2020 06:14:00 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03ams.nl.ibm.com with ESMTP id 32gcpx4p8x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Jul 2020 06:14:00 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06T6CXTA56754548 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jul 2020 06:12:33 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A6FC4AE051; Wed, 29 Jul 2020 06:13:58 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5EBF6AE04D; Wed, 29 Jul 2020 06:13:56 +0000 (GMT) Received: from linux.vnet.ibm.com (unknown [9.126.150.29]) by d06av26.portsmouth.uk.ibm.com (Postfix) with SMTP; Wed, 29 Jul 2020 06:13:56 +0000 (GMT) Date: Wed, 29 Jul 2020 11:43:55 +0530 From: Srikar Dronamraju To: Valentin Schneider Cc: Michael Ellerman , linuxppc-dev , LKML , Nicholas Piggin , Anton Blanchard , "Oliver O'Halloran" , Nathan Lynch , Michael Neuling , Gautham R Shenoy , Ingo Molnar , Peter Zijlstra , Jordan Niethe Subject: Re: [PATCH v4 09/10] Powerpc/smp: Create coregroup domain Message-ID: <20200729061355.GA14603@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20200727053230.19753-1-srikar@linux.vnet.ibm.com> <20200727053230.19753-10-srikar@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-29_02:2020-07-28,2020-07-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 priorityscore=1501 phishscore=0 mlxlogscore=999 bulkscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007290038 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Valentin Schneider [2020-07-28 16:03:11]: Hi Valentin, Thanks for looking into the patches. > On 27/07/20 06:32, Srikar Dronamraju wrote: > > Add percpu coregroup maps and masks to create coregroup domain. > > If a coregroup doesn't exist, the coregroup domain will be degenerated > > in favour of SMT/CACHE domain. > > > > So there's at least one arm64 platform out there with the same "pairs of > cores share L2" thing (Ampere eMAG), and that lives quite happily with the > default scheduler topology (SMT/MC/DIE). Each pair of core gets its MC > domain, and the whole system is covered by DIE. > > Now arguably it's not a perfect representation; DIE doesn't have > SD_SHARE_PKG_RESOURCES so the highest level sd_llc can point to is MC. That > will impact all callsites using cpus_share_cache(): in the eMAG case, only > pairs of cores will be seen as sharing cache, even though *all* cores share > the same L3. > Okay, Its good to know that we have a chip which is similar to P9 in topology. > I'm trying to paint a picture of what the P9 topology looks like (the one > you showcase in your cover letter) to see if there are any similarities; > from what I gather in [1], wikichips and your cover letter, with P9 you can > have something like this in a single DIE (somewhat unsure about L3 setup; > it looks to be distributed?) > > +---------------------------------------------------------------------+ > | L3 | > +---------------+-+---------------+-+---------------+-+---------------+ > | L2 | | L2 | | L2 | | L2 | > +------+-+------+ +------+-+------+ +------+-+------+ +------+-+------+ > | L1 | | L1 | | L1 | | L1 | | L1 | | L1 | | L1 | | L1 | > +------+ +------+ +------+ +------+ +------+ +------+ +------+ +------+ > |4 CPUs| |4 CPUs| |4 CPUs| |4 CPUs| |4 CPUs| |4 CPUs| |4 CPUs| |4 CPUs| > +------+ +------+ +------+ +------+ +------+ +------+ +------+ +------+ > > Which would lead to (ignoring the whole SMT CPU numbering shenanigans) > > NUMA [ ... > DIE [ ] > MC [ ] [ ] [ ] [ ] > BIGCORE [ ] [ ] [ ] [ ] > SMT [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] > 00-03 04-07 08-11 12-15 16-19 20-23 24-27 28-31 > What you have summed up is perfectly what a P9 topology looks like. I dont think I could have explained it better than this. > This however has MC == BIGCORE; what makes it you can have different spans > for these two domains? If it's not too much to ask, I'd love to have a P9 > topology diagram. > > [1]: 20200722081822.GG9290@linux.vnet.ibm.com At this time the current topology would be good enough i.e BIGCORE would always be equal to a MC. However in future we could have chips that can have lesser/larger number of CPUs in llc than in a BIGCORE or we could have granular or split L3 caches within a DIE. In such a case BIGCORE != MC. Also in the current P9 itself, two neighbouring core-pairs form a quad. Cache latency within a quad is better than a latency to a distant core-pair. Cache latency within a core pair is way better than latency within a quad. So if we have only 4 threads running on a DIE all of them accessing the same cache-lines, then we could probably benefit if all the tasks were to run within the quad aka MC/Coregroup. I have found some benchmarks which are latency sensitive to benefit by having a grouping a quad level (using kernel hacks and not backed by firmware changes). Gautham also found similar results in his experiments but he only used binding within the stock kernel. I am not setting SD_SHARE_PKG_RESOURCES in MC/Coregroup sd_flags as in MC domain need not be LLC domain for Power. -- Thanks and Regards Srikar Dronamraju