Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1016878rdb; Fri, 20 Oct 2023 06:22:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEtqX1jRQR/FiV2wTWB/kh3wz13yjkxwEB5LrgcxoOqAr/POV0qstb+YeJTCrYanA7lkhsY X-Received: by 2002:a17:90a:1a15:b0:27c:efd2:9a0b with SMTP id 21-20020a17090a1a1500b0027cefd29a0bmr1754023pjk.39.1697808121384; Fri, 20 Oct 2023 06:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697808121; cv=none; d=google.com; s=arc-20160816; b=VD7tYoS3GvaKyI9GjobQKGILoChus5q2AdXozqEzNmBzrF8EqtRRT0DBGwQEDM+UQx N/hO54iIDKAr1qCd6ij9oLIr4mni8ja9Puihre3EAMLdP2SUj6ABTFL/VjqKFBejsJeS GiU3h79Pzn9Wl726zLKCMocwTt8ISJCfMm63kPYLgFljyBnFwXOg3xBQQrU0RYuUSOwN x+wHUXmXexDWKwdP9FhkSTLKKvHckvy5XWqc6wDbN/cZseB8SNN6CrtzlKzNFT7miPPF AJdUupWNOBDQo3yvCSaOw+rX35cO6MK2jN96JErqnPwbSZ0DINAy0qC2828SWc4DLY2b TRAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=cn3A9D3vs6gY2tISNgTA79RuBjXE7FcJPQkABNQ9BwA=; fh=L8AEHncSc94Zz9EwgivEYXr5jLNZ1TaquIRRMDlUDyM=; b=Yu+Gzgub48vq0zvN3A8PxyBaQ8nZWnPQVOxVeX0crTceX1dvmpTMrqv6SK3JUDJB7k CPLMuUdmClPI2Yfc4zB8jhkWQnLFFmH9B7safgh/YhviWb6P8Ksy9lhNmsKXLGElc+8o kZ7WifUOo4RyGOvIN2QwzjQ5pZYYDLqmAXYa46okYCbH9mvOkUkzYcboqpRcylCnZfTz tdhr692KRnVH076YH5q2vQerPR16NwseWWH1NOLE4bzaoJk+XA6gcnaWZgiuTNBGwaH3 C2L/PjTUlrmE2bro6YLXQCfq88RnRJaHNvuKgoSI7tUf0k/heU/HXY8/63WAPGvbhrGk QbIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=G+nTgB+i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id bf20-20020a656d14000000b00578e0ff59bbsi1920527pgb.865.2023.10.20.06.22.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 06:22:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=G+nTgB+i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 74E9B835C16E; Fri, 20 Oct 2023 06:21:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377176AbjJTNVt (ORCPT + 99 others); Fri, 20 Oct 2023 09:21:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376933AbjJTNVt (ORCPT ); Fri, 20 Oct 2023 09:21:49 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF28A1A4 for ; Fri, 20 Oct 2023 06:21:46 -0700 (PDT) Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39KCu0RV022006; Fri, 20 Oct 2023 13:21:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : reply-to : references : mime-version : content-type : in-reply-to; s=pp1; bh=cn3A9D3vs6gY2tISNgTA79RuBjXE7FcJPQkABNQ9BwA=; b=G+nTgB+iePeMNdTHG/B8DIFgpa75BuZWtWWB52BX7C3opbouI4cq+SmHdQOjN6rSwXW9 pUzRL5b7i+0EFU4CN7aFL2LKRRSWuNVlpNkD3odXBh12SQIJB6j5C3pFh6UqzO+a6PEr EbQx8sC6nf9PgWTIzyH+gU211stV2ri4kn0oAm3yn/S4BfTJGnoVFxSPhuHIRfo6edjh JGLMEsf5DnOcWGVj7QJ2kYQJybNVCuVu6FVOPAvd2R6dfiicIGzVmCQXoO3Zu6mJXcwd QsL+nPGnn7hM5xVgJspNQjUO9wE9IG16Kq/ezv7zkxz6vyJGKTmwLCWApAAECd1v0phz Tg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tusyyh3sw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 13:21:22 +0000 Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39KD48dD011989; Fri, 20 Oct 2023 13:21:17 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tusyyh3bn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 13:21:17 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39KC3cYV024191; Fri, 20 Oct 2023 13:21:11 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tuc294rwq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 13:21:11 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39KDL9Wa9503376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 13:21:09 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 14C3C20043; Fri, 20 Oct 2023 13:21:09 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B435820040; Fri, 20 Oct 2023 13:21:06 +0000 (GMT) Received: from linux.vnet.ibm.com (unknown [9.126.150.29]) by smtpav05.fra02v.mail.ibm.com (Postfix) with SMTP; Fri, 20 Oct 2023 13:21:06 +0000 (GMT) Date: Fri, 20 Oct 2023 18:51:05 +0530 From: Srikar Dronamraju To: Michael Ellerman Cc: linuxppc-dev , Nicholas Piggin , Christophe Leroy , Peter Zijlstra , ndesaulniers@google.com, Nathan Lynch , Josh Poimboeuf , Mark Rutland , linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc/smp: Dynamically build powerpc topology Message-ID: <20231020132105.GN2194132@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20230830122614.73067-1-srikar@linux.vnet.ibm.com> <874jil5wa8.fsf@mail.lhotse> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <874jil5wa8.fsf@mail.lhotse> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 7QUhefKdV8FgB4G3v769i-HgoQuO5-H9 X-Proofpoint-ORIG-GUID: wiPZSuxEnd9zgKljV5LUPxO-V1kNW2cZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-20_10,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 priorityscore=1501 impostorscore=0 phishscore=0 clxscore=1015 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310200108 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 20 Oct 2023 06:21:58 -0700 (PDT) * Michael Ellerman [2023-10-20 23:10:55]: > Srikar Dronamraju writes: > > Currently there are four powerpc specific sched topologies. These are > > all statically defined. However not all these topologies are used by > > all powerpc systems. > > > > To avoid unnecessary degenerations by the scheduler , masks and flags > > are compared. However if the sched topologies are build dynamically then > > the code is simpler and there are greater chances of avoiding > > degenerations. > > > > Even x86 builds its sched topologies dynamically and new changes are > > very similar to the way x86 is building its topologies. > > > > System Configuration > > type=Shared mode=Uncapped smt=8 lcpu=128 mem=1063126592 kB cpus=96 ent=40.00 > > > > $ lscpu > > Architecture: ppc64le > > Byte Order: Little Endian > > CPU(s): 1024 > > On-line CPU(s) list: 0-1023 > > Model name: POWER10 (architected), altivec supported > > Model: 2.0 (pvr 0080 0200) > > Thread(s) per core: 8 > > Core(s) per socket: 32 > > Socket(s): 4 > > Hypervisor vendor: pHyp > > Virtualization type: para > > L1d cache: 8 MiB (256 instances) > > L1i cache: 12 MiB (256 instances) > > NUMA node(s): 4 > > > > From dmesg of v6.5 > > [ 0.174444] smp: Bringing up secondary CPUs ... > > [ 3.918535] smp: Brought up 4 nodes, 1024 CPUs > > [ 38.001402] sysrq: Changing Loglevel > > [ 38.001446] sysrq: Loglevel set to 9 > > > > From dmesg of v6.5 + patch > > [ 0.174462] smp: Bringing up secondary CPUs ... > > [ 3.421462] smp: Brought up 4 nodes, 1024 CPUs > > [ 35.417917] sysrq: Changing Loglevel > > [ 35.417959] sysrq: Loglevel set to 9 > > > > 5 runs of ppc64_cpu --smt=1 (time measured: lesser is better) > > Kernel N Min Max Median Avg Stddev %Change > > v6.5 5 518.08 574.27 528.61 535.388 22.341542 > > +patch 5 481.73 495.47 484.21 486.402 5.7997 -9.14963 > > > > 5 runs of ppc64_cpu --smt=8 (time measured: lesser is better) > > Kernel N Min Max Median Avg Stddev %Change > > v6.5 5 1094.12 1117.1 1108.97 1106.3 8.606361 > > +patch 5 1067.5 1090.03 1073.89 1076.574 9.4189347 -2.68697 > > > > Signed-off-by: Srikar Dronamraju > > --- > > arch/powerpc/kernel/smp.c | 78 ++++++++++++++------------------------- > > 1 file changed, 28 insertions(+), 50 deletions(-) > > > > diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c > > index 48b8161179a8..c16443a04c26 100644 > > --- a/arch/powerpc/kernel/smp.c > > +++ b/arch/powerpc/kernel/smp.c > > @@ -92,15 +92,6 @@ EXPORT_PER_CPU_SYMBOL(cpu_l2_cache_map); > > EXPORT_PER_CPU_SYMBOL(cpu_core_map); > > EXPORT_SYMBOL_GPL(has_big_cores); > > > > -enum { > > -#ifdef CONFIG_SCHED_SMT > > - smt_idx, > > -#endif > > - cache_idx, > > - mc_idx, > > - die_idx, > > -}; > > - > > #define MAX_THREAD_LIST_SIZE 8 > > #define THREAD_GROUP_SHARE_L1 1 > > #define THREAD_GROUP_SHARE_L2_L3 2 > > @@ -1048,16 +1039,6 @@ static const struct cpumask *cpu_mc_mask(int cpu) > > return cpu_coregroup_mask(cpu); > > } > > > > -static struct sched_domain_topology_level powerpc_topology[] = { > > -#ifdef CONFIG_SCHED_SMT > > - { cpu_smt_mask, powerpc_smt_flags, SD_INIT_NAME(SMT) }, > > -#endif > > - { shared_cache_mask, powerpc_shared_cache_flags, SD_INIT_NAME(CACHE) }, > > - { cpu_mc_mask, powerpc_shared_proc_flags, SD_INIT_NAME(MC) }, > > - { cpu_cpu_mask, powerpc_shared_proc_flags, SD_INIT_NAME(DIE) }, > > - { NULL, }, > > -}; > > This doesn't apply on my next or upstream. > > It looks like it depends on your other 6-patch series. Please append > this patch to that series. > > cheers Ok, will do the needful in the next iteration. -- Thanks and Regards Srikar Dronamraju