Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp323396rdh; Thu, 26 Oct 2023 03:22:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzRKh4ePC70VcfD0csNb+xDpSwyIGMSmN7fTbGSoPCntkRQP6PjjaKkrWjGHi3QXWGOz2c X-Received: by 2002:a81:91d5:0:b0:5a7:bc79:9618 with SMTP id i204-20020a8191d5000000b005a7bc799618mr19095359ywg.12.1698315740422; Thu, 26 Oct 2023 03:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698315740; cv=none; d=google.com; s=arc-20160816; b=qwvT/TL/gW5RwBJLN5vHqUDkOsyi5lH1FM4U0ME+6244jkO8aWUqO/uC5+4y+MtLXG Ze+Ls46cb0kYqB18PD12+uxKQFJkCQ+06AnEc+1sCNZDFfU3rSMigdX81cpyPi4ZtXT7 gyq5bQlhEtntGtW7EZjbCSud/aBjEmOtW7zVjZ2trNhrR7ozGL+zYC2n3HQ9QJqTAndu apGrFbfwJ71Fu/uCuXWyWtPQncrfHstRy6RqAFdlM/drFjoUv9U8Q528sA6pXKqvxJIP LhHZHgQ1SCkx1CKfj8KJX3xnpQWz1RFotqqnfjWnU3nq01knrePze6EtI4j7vAz4XcQp ftBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=n9gjFqsBWsmBy4mOUJ1TsaGzVb1LxD6lsba8tEZdEYE=; fh=5z+0vShyGRqygqyBWJvN8XEHSGOn/Wwhc5bHXT9v6So=; b=xtFI0mqys8SMJpfDPb1TBPp9o9a6HcSSMzBwWCmDFZKTJewlIKMJbYaR+HvIx1DPfp JP7qOZ3ZZlnqygeNI8Yip7OVtnSxRPeyM3f3kpOwOU5yJR6r7HLKjJZVy906GuF5xtyv abQ6QIbeQwyJUjgMUYPL4mDnYsqL986SXsBtxZAslYhtlSdsjHXeyo6ArIljd30Ir+/B oh5F3ryvAKCJQPzovIjav34/57nnOESwoWJx05tml8bnP8ccn6CeqBSuUTdfMqVBMRhA Lrl8FWy/ywsqmgpMb8fZ0GUArpG+r2w9MAtwX7KdhGplTPzTBRjRxgKA7TUyRiZ8KM5b reLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Siofr+M6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id dc1-20020a05690c0f0100b005af28793c23si840606ywb.91.2023.10.26.03.22.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 03:22:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Siofr+M6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 661C8809688D; Thu, 26 Oct 2023 03:20:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234948AbjJZKUD (ORCPT + 99 others); Thu, 26 Oct 2023 06:20:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231311AbjJZKUA (ORCPT ); Thu, 26 Oct 2023 06:20:00 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1968FDC for ; Thu, 26 Oct 2023 03:19:58 -0700 (PDT) Received: from pps.filterd (m0353727.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39QAHVtV032428; Thu, 26 Oct 2023 10:19:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pp1; bh=n9gjFqsBWsmBy4mOUJ1TsaGzVb1LxD6lsba8tEZdEYE=; b=Siofr+M6uNqtWpAiS1LiYmvzsoERrW7JXEvvPmru9j0xSiLYhn5fS/NWUK9MmdM8VtFB 1/O8tFJk7vTF3zi2OOEkPaw8l39bvyPy/lsaZUvn1C025TehpTM35h/vc8ddDjc7KgH6 9uHd7R2e9EPHi1zUrW76BfYAo/V1FSp0RY6CuaET5lcY/sI63crytVfBvnhkMribmOnS /0mndvcfz0NtN3S0fXY+medXVKkmy6C6C5uVsD2hTp6LwoBIdQqpZFbLEhE3YShZWVP1 ETvsB8egmcZORezcg2011b1OG88VYJasQkO4fwCVgirwY+XW20hX0kSLywfz5vm1wsqq PA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3typ7q05s3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Oct 2023 10:19:39 +0000 Received: from m0353727.ppops.net (m0353727.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39QAHt5B002113; Thu, 26 Oct 2023 10:19:39 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3typ7q05gv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Oct 2023 10:19:38 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39Q8JXkU010218; Thu, 26 Oct 2023 10:19:33 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tvsbywj6m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Oct 2023 10:19:33 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39QAJVN011600430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Oct 2023 10:19:31 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5680E2007C; Thu, 26 Oct 2023 10:19:31 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0ED4920063; Thu, 26 Oct 2023 10:19:29 +0000 (GMT) Received: from sapthagiri.in.ibm.com (unknown [9.109.198.113]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 26 Oct 2023 10:19:28 +0000 (GMT) From: Srikar Dronamraju To: Michael Ellerman Cc: linuxppc-dev , Srikar Dronamraju , Christophe Leroy , linux-kernel@vger.kernel.org, Mark Rutland , "ndesaulniers@google.com" , Nicholas Piggin , "Paul E. McKenney" , "Peter Zijlstra (Intel)" , Rohan McLure , Valentin Schneider Subject: [PATCH v3 0/5] powerpc/smp: Topology and shared processor optimizations Date: Thu, 26 Oct 2023 15:48:35 +0530 Message-ID: <20231026101843.56784-1-srikar@linux.vnet.ibm.com> X-Mailer: git-send-email 2.41.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: X1WE97JUtTu6wonjl0KV-_Lpchqd-iwk X-Proofpoint-ORIG-GUID: k0T5He0QHbCm8uZRCzr6yNY5I6U2rERh Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-26_08,2023-10-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 bulkscore=0 malwarescore=0 spamscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310260087 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 fry.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 (fry.vger.email [0.0.0.0]); Thu, 26 Oct 2023 03:20:32 -0700 (PDT) PowerVM systems configured in shared processors mode have some unique challenges. Some device-tree properties will be missing on a shared processor. Hence some sched domains may not make sense for shared processor systems. Most shared processor systems are over-provisioned. Underlying PowerVM Hypervisor would schedule at a Big Core granularity. The most recent power processors support two almost independent cores. In a lightly loaded condition, it helps the overall system performance if we pack to lesser number of Big Cores. System Configuration type=Shared mode=Uncapped smt=8 lcpu=96 mem=1066409344 kB cpus=96 ent=64.00 So *64 Entitled cores/ 96 Virtual processor* Scenario lscpu Architecture: ppc64le Byte Order: Little Endian CPU(s): 768 On-line CPU(s) list: 0-767 Model name: POWER10 (architected), altivec supported Model: 2.0 (pvr 0080 0200) Thread(s) per core: 8 Core(s) per socket: 16 Socket(s): 6 Hypervisor vendor: pHyp Virtualization type: para L1d cache: 6 MiB (192 instances) L1i cache: 9 MiB (192 instances) NUMA node(s): 6 NUMA node0 CPU(s): 0-7,32-39,80-87,128-135,176-183,224-231,272-279,320-327,368-375,416-423,464-471,512-519,560-567,608-615,656-663,704-711,752-759 NUMA node1 CPU(s): 8-15,40-47,88-95,136-143,184-191,232-239,280-287,328-335,376-383,424-431,472-479,520-527,568-575,616-623,664-671,712-719,760-767 NUMA node4 CPU(s): 64-71,112-119,160-167,208-215,256-263,304-311,352-359,400-407,448-455,496-503,544-551,592-599,640-647,688-695,736-743 NUMA node5 CPU(s): 16-23,48-55,96-103,144-151,192-199,240-247,288-295,336-343,384-391,432-439,480-487,528-535,576-583,624-631,672-679,720-727 NUMA node6 CPU(s): 72-79,120-127,168-175,216-223,264-271,312-319,360-367,408-415,456-463,504-511,552-559,600-607,648-655,696-703,744-751 NUMA node7 CPU(s): 24-31,56-63,104-111,152-159,200-207,248-255,296-303,344-351,392-399,440-447,488-495,536-543,584-591,632-639,680-687,728-735 ebizzy -t 32 -S 200 (5 iterations) Records per second. (Higher is better) Kernel N Min Max Median Avg Stddev %Change 6.6.0-rc3 5 3840178 4059268 3978042 3973936.6 84264.456 +patch 5 3768393 3927901 3874994 3854046 71532.926 -3.01692 >From lparstat (when the workload stabilized) Kernel %user %sys %wait %idle physc %entc lbusy app vcsw phint 6.6.0-rc3 4.16 0.00 0.00 95.84 26.06 40.72 4.16 69.88 276906989 578 +patch 4.16 0.00 0.00 95.83 17.70 27.66 4.17 78.26 70436663 119 ebizzy -t 128 -S 200 (5 iterations) Records per second. (Higher is better) Kernel N Min Max Median Avg Stddev %Change 6.6.0-rc3 5 5520692 5981856 5717709 5727053.2 176093.2 +patch 5 5305888 6259610 5854590 5843311 375917.03 2.02998 >From lparstat (when the workload stabilized) Kernel %user %sys %wait %idle physc %entc lbusy app vcsw phint 6.6.0-rc3 16.66 0.00 0.00 83.33 45.49 71.08 16.67 50.50 288778533 581 +patch 16.65 0.00 0.00 83.35 30.15 47.11 16.65 65.76 85196150 133 ebizzy -t 512 -S 200 (5 iterations) Records per second. (Higher is better) Kernel N Min Max Median Avg Stddev %Change 6.6.0-rc3 5 19563921 20049955 19701510 19728733 198295.18 +patch 5 19455992 20176445 19718427 19832017 304094.05 0.523521 >From lparstat (when the workload stabilized) %Kernel user %sys %wait %idle physc %entc lbusy app vcsw phint 66.6.0-rc3 6.44 0.01 0.00 33.55 94.14 147.09 66.45 1.33 313345175 621 6+patch 6.44 0.01 0.00 33.55 94.15 147.11 66.45 1.33 109193889 309 System Configuration type=Shared mode=Uncapped smt=8 lcpu=40 mem=1067539392 kB cpus=96 ent=40.00 So *40 Entitled cores/ 40 Virtual processor* Scenario lscpu Architecture: ppc64le Byte Order: Little Endian CPU(s): 320 On-line CPU(s) list: 0-319 Model name: POWER10 (architected), altivec supported Model: 2.0 (pvr 0080 0200) Thread(s) per core: 8 Core(s) per socket: 10 Socket(s): 4 Hypervisor vendor: pHyp Virtualization type: para L1d cache: 2.5 MiB (80 instances) L1i cache: 3.8 MiB (80 instances) NUMA node(s): 4 NUMA node0 CPU(s): 0-7,32-39,64-71,96-103,128-135,160-167,192-199,224-231,256-263,288-295 NUMA node1 CPU(s): 8-15,40-47,72-79,104-111,136-143,168-175,200-207,232-239,264-271,296-303 NUMA node4 CPU(s): 16-23,48-55,80-87,112-119,144-151,176-183,208-215,240-247,272-279,304-311 NUMA node5 CPU(s): 24-31,56-63,88-95,120-127,152-159,184-191,216-223,248-255,280-287,312-319 ebizzy -t 32 -S 200 (5 iterations) Records per second. (Higher is better) Kernel N Min Max Median Avg Stddev %Change 6.6.0-rc3 5 3535518 3864532 3745967 3704233.2 130216.76 +patch 5 3608385 3708026 3649379 3651596.6 37862.163 -1.42099 %Kernel user %sys %wait %idle physc %entc lbusy app vcsw phint 6.6.0-rc3 10.00 0.01 0.00 89.99 22.98 57.45 10.01 41.01 1135139 262 +patch 10.00 0.00 0.00 90.00 16.95 42.37 10.00 47.05 925561 19 ebizzy -t 64 -S 200 (5 iterations) Records per second. (Higher is better) Kernel N Min Max Median Avg Stddev %Change 6.6.0-rc3 5 4434984 4957281 4548786 4591298.2 211770.2 +patch 5 4461115 4835167 4544716 4607795.8 151474.85 0.359323 %Kernel user %sys %wait %idle physc %entc lbusy app vcsw phint 6.6.0-rc3 20.01 0.00 0.00 79.99 38.22 95.55 20.01 25.77 1287553 265 +patch 19.99 0.00 0.00 80.01 25.55 63.88 19.99 38.44 1077341 20 ebizzy -t 256 -S 200 (5 iterations) Records per second. (Higher is better) Kernel N Min Max Median Avg Stddev %Change 6.6.0-rc3 5 8850648 8982659 8951911 8936869.2 52278.031 +patch 5 8751038 9060510 8981409 8942268.4 117070.6 0.0604149 %Kernel user %sys %wait %idle physc %entc lbusy app vcsw phint 6.6.0-rc3 80.02 0.01 0.01 19.96 40.00 100.00 80.03 24.00 1597665 276 +patch 80.02 0.01 0.01 19.96 40.00 100.00 80.03 23.99 1383921 63 Observation: We are able to see Improvement in ebizzy throughput even with lesser core utilization (almost half the core utilization) in low utilization scenarios while still retaining throughput in mid and higher utilization scenarios. Note: The numbers are with Uncapped + no-noise case. In the Capped and/or noise case, due to contention on the Cores, the numbers are expected to further improve. Note: The numbers included (powerpc/paravirt: Improve vcpu_is_preempted) http://lore.kernel.org/all/20231019091452.95260-1-srikar@linux.vnet.ibm.com/ and (sched/fair: Enable group_asym_packing in find_idlest_group) https://lore.kernel.org/all/20231018155036.2314342-1-srikar@linux.vnet.ibm.com/ Changelog v1 (https://lore.kernel.org/all/20230830105244.62477-1-srikar@linux.vnet.ibm.com) -> v2: 1. Last two patches were added in this version 2. This version uses static keys v2 (https://lore.kernel.org/all/20231018163751.2423181-1-srikar@linux.vnet.ibm.com) ->v3: 1. Handle comments from Peter Zijlstra / Michael Ellerman 2. Use __ro_after_init attribute instead of read_mostly 3. Use cpu_has_feature static_key instead of a new one. 4. Build topology dynamically patch added to this patchset. Cc: Christophe Leroy Cc: linux-kernel@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: Mark Rutland Cc: Michael Ellerman Cc: "ndesaulniers@google.com" Cc: Nicholas Piggin Cc: "Paul E. McKenney" Cc: "Peter Zijlstra (Intel)" Cc: Rohan McLure Cc: Srikar Dronamraju Cc: Valentin Schneider Srikar Dronamraju (5): powerpc/smp: Enable Asym packing for cores on shared processor powerpc/smp: Disable MC domain for shared processor powerpc/smp: Add __ro_after_init attribute powerpc/smp: Avoid asym packing within thread_group of a core powerpc/smp: Dynamically build Powerpc topology arch/powerpc/kernel/smp.c | 136 +++++++++++++++++++++----------------- 1 file changed, 76 insertions(+), 60 deletions(-) base-commit: 4d121328397f83465b6c1f60c5fad93bda9bc90e -- 2.31.1