Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp645745imm; Fri, 11 May 2018 04:18:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZptuB5kLT3OmXVENjT5S+lgS0nw1ExH28k+8dGwS9n4Mq5+S49ZahNBLHH/361r9BE4CBQF X-Received: by 2002:a65:5c06:: with SMTP id u6-v6mr4217610pgr.316.1526037501227; Fri, 11 May 2018 04:18:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526037501; cv=none; d=google.com; s=arc-20160816; b=VSdbFLMGk3vFLz17oB440HwWpLBiNV/n6Hpp4xY+fBynAFWX67oMF+e/hCtcOUZ+q1 7HSV0/3bCngI1xIrOr32SFyb/YB5VG8Vj8wyg7ilP/9ieMNznfFNQZTK5o4mSJOUZ2kF wdCZvf4sGijryEsr3bmXxrgI9zmLG+WTTB9WWYBT5Tsy/GUEJVR5OjtOmS0Hp/c3db7E xI3VAiuz4GuntSLczhH9JKMdEP8llJEPjq8lNnkj5PYYZtblB4m0CX6TJ7tllov8fD82 FVPDFRbIajveTcsEn26S5Qmw/O07B6nEBSe8P0XY83rGUELJ5in273DpwLlqZ5AQiE9f 407Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=AKd+NDU1zzcCpHf3+NRM8HAu6p5tU39WFUYl99q2yMU=; b=IkSNHdOW/Rdz0U088gKy7V7llihhPSaA3aaw83XNWVwgRFGwgeiyY+i/c9hn9x02+X vJxZSYg/PbeOHVXHI94BybY0p2FDWljBoD9Ua4Lwc22RUWasvJhwkypPGI4msdGIp8Qc eQicInyNFz3loyHsddCTJv0/VOoWD+khFdYm4EDK1QgNV7ts1TdQoOKT4xWqW+MacdvL Brv2FsyFqppvtdAWJYyXOOM6RRMVWm6mVKf4JbegEEloNJ6cmVdTJQju1zkOjIWP/P48 BuvtUJYXwj2DTnWowTQy2DF3b0WlI2N2az8WrFXciVLwji7Xi1KEMo/eD8msqsDgcari PwfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 24-v6si3202174pfj.6.2018.05.11.04.18.06; Fri, 11 May 2018 04:18:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1753284AbeEKLRp (ORCPT + 99 others); Fri, 11 May 2018 07:17:45 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44008 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753115AbeEKLRm (ORCPT ); Fri, 11 May 2018 07:17:42 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4BB9uWf035929 for ; Fri, 11 May 2018 07:17:42 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hw7bm7d5u-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 11 May 2018 07:17:41 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 11 May 2018 07:17:41 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 11 May 2018 07:17:38 -0400 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4BBHbGH45613246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 11 May 2018 11:17:37 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9E5C011204B; Fri, 11 May 2018 07:17:34 -0400 (EDT) Received: from sofia.ibm.com (unknown [9.77.201.139]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP id 4B94E112047; Fri, 11 May 2018 07:17:34 -0400 (EDT) Received: by sofia.ibm.com (Postfix, from userid 1000) id C369D2E2E0D; Fri, 11 May 2018 16:47:31 +0530 (IST) From: "Gautham R. Shenoy" To: Michael Ellerman , Benjamin Herrenschmidt , Michael Neuling , Vaidyanathan Srinivasan , Akshay Adiga , Shilpasri G Bhat , Balbir Singh , "Oliver O'Halloran" , Nicholas Piggin Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, "Gautham R. Shenoy" Subject: [PATCH 0/2] powerpc: Scheduler optimization for POWER9 bigcores Date: Fri, 11 May 2018 16:47:22 +0530 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 18051111-0048-0000-0000-0000026B93CF X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009005; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000259; SDB=6.01030698; UDB=6.00526774; IPR=6.00809829; MB=3.00021044; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-11 11:17:40 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051111-0049-0000-0000-000045153E7B Message-Id: <1526037444-22876-1-git-send-email-ego@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-11_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805110107 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Gautham R. Shenoy" Hi, A pair of IBM POWER9 SMT4 cores can be fused together to form a big-core with 8 SMT threads. This can be discovered via the "ibm,thread-groups" CPU property in the device tree which will indicate which group of threads that share the L1 cache, translation cache and instruction data flow. If there are multiple such group of threads, then the core is a big-core. Furthermore, the thread-ids of such a big-core is obtained by interleaving the thread-ids of the component SMT4 cores. Eg: Threads in the pair of component SMT4 cores of an interleaved big-core are numbered {0,2,4,6} and {1,3,5,7} respectively. On such a big-core, when multiple tasks are scheduled to run on the big-core, we get the best performance when the tasks are spread across the pair of SMT4 cores. The Linux scheduler has a feature called "ASYM_SMT" which will bias the load-balancing of the tasks on the smaller numbered threads in the core. On an big-core whose threads are interleavings of the threads of the small cores, enabling ASYM_SMT automatically results in spreading the tasks uniformly across the associated pair of SMT4 cores. In this patchset, we detect if the cores are big-cores with interleaved threads. If so, we enable ASYM_SMT feature at the SMT-sched domain. Experimental results for ebizzy with 2 threads, bound to a single big-core show a marked improvement with this patchset over the 4.17-rc3 vanilla kernel. The results of 100 such runs, for 4.17-rc3 vanilla kernel and 4.17-rc3 + this_patchset are as follows. 4.17-rc3 vanilla: ================================================ ebizzy records/s :# samples: Histogram ================================================= [1000000 - 2000000] : 14 : ### [2000000 - 3000000] : 13 : ### [3000000 - 4000000] : 15 : #### [4000000 - 5000000] : 2 : # [5000000 - 6000000] : 56 : ############ ================================================= 4.17-rc3 vanilla + this_patchset ================================================= ebizzy records/s :# samples: Histogram ================================================= [1000000 - 2000000] : 0 : # [2000000 - 3000000] : 14 : ### [3000000 - 4000000] : 0 : # [4000000 - 5000000] : 1 : # [5000000 - 6000000] : 85 : ################## ================================================= This patchset contains two patchset. The first patch detects the presence of big-cores with interleaved threads. The second patch adds the ASYM_SMT bit to the flags the SMT-sched domain when interleaved big-cores are detected. Gautham R. Shenoy (2): powerpc: Detect the presence of big-core with interleaved threads powerpc: Enable ASYM_SMT on interleaved big-core systems arch/powerpc/include/asm/cputhreads.h | 8 +++-- arch/powerpc/kernel/setup-common.c | 63 +++++++++++++++++++++++++++++++++-- arch/powerpc/kernel/smp.c | 2 +- 3 files changed, 67 insertions(+), 6 deletions(-) -- 1.9.4