Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2563435pxb; Mon, 18 Jan 2021 23:40:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJG/XbdIJ0wCX2h07m7bFqWZl3LPkFwF4dBXNbCuGqlVEqz+DxBvKaeb9rn+RTJL+10x0x X-Received: by 2002:a17:906:a115:: with SMTP id t21mr2104666ejy.549.1611042027916; Mon, 18 Jan 2021 23:40:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611042027; cv=none; d=google.com; s=arc-20160816; b=iUzkn/Ecw7jv+bN0pnvvSCT2XVGnkgCnnUMoo50GMbFpIRVlXc65ftvuWKBCdI2YBb aKuE3OSKRPiv0zYGkOMyPcXVXrBSV9Qol3i6UZHZYrE9C7H4lnSXSQVTfjWMZcmz4UA+ Olqu6xhQPs5PqgQLEYmRhOYzr9U0lc5gUlap9Q6BKJ+wPxsec/MAgGoJqDESkc96lS7Y vzD5c4BhAHL8mB7OSj7d4DGqMFWOOVjTgI5UHwJZQB1rpoT30jtxKvtfigV1YPTh/sz2 BYuq8rjIRMelY4vw/2ZUW8s3+PdxRZY0SWGUg7IyC0RAV/pUNrPOu3pJ5fwFMKxZlTyk awfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=+qIzXIBMsoplKGqI4+slcFF/1Ae/KuT5AYoNIFZCeYk=; b=TAFBHrfIB+3dBt/MxGqy2VNw0XrxOC8sOlrRW4tPrYXjp+M/7HrG8pugkyuDhge4mx zypzcQ8aAjfwjBqp7396evTS/NwTwyTwNdQXpiM+rX33vvBvvZS1mJ4Hpm/ATgmMUFYl wajV6RSM/DXuElBWm7hIdZo9nkt85WWmFXa0h84g9QjvYPoODKDWquEAiWs8dtvEY0p8 FNXjdcqNNe1F9E4jUU2QnjLwb5rPxC4HP3eEsEFMc+/w4B6AhwWg+BF3DfSic1r3/ZYX hKCghSEz6T75+fl7aGmrRc9+ePZIdqt0v/KnEctBNQGT2I3neHisMw4dTVGGvJIUaABv TEYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=CloMoG8R; 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=pass (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 h16si7852592ejy.432.2021.01.18.23.40.04; Mon, 18 Jan 2021 23:40:27 -0800 (PST) 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; dkim=pass header.i=@ibm.com header.s=pp1 header.b=CloMoG8R; 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=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729385AbhASHiG (ORCPT + 99 others); Tue, 19 Jan 2021 02:38:06 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:4998 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728608AbhASHhb (ORCPT ); Tue, 19 Jan 2021 02:37:31 -0500 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 10J7X2kM113164; Tue, 19 Jan 2021 02:36:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id; s=pp1; bh=+qIzXIBMsoplKGqI4+slcFF/1Ae/KuT5AYoNIFZCeYk=; b=CloMoG8R9lJlgcj21AxKhZSfewBzaW6MojVjS9RNmPOAvb9x1itSGaEBvj+ZrQDl3xPJ JmGcPBn8g2xLSBEobsBNThDqDI+MhYlCSX7F9oustC/MBaQFzhvRMWd4P+mjBfizuoDg YtUCDV5/FHW15eMw8rEtVkw07DIMY5ayzq0KPe7MXWNtJMYeH3B78iEPLyMdUassSIt2 7Jp6Mmqzkjx094Kuu/TYarmtiUxsDOWXJsu6+4+d2CQuB5hWRYOoERN+yQPpnX2LjuXk NpNxnG2ZfiQqaC0g0i9iLBFAwF3TMbmfaBgcmXv0NaAYObvafN7FkOX2atqJ+n6dSRaf ow== Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 365t87195n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Jan 2021 02:36:37 -0500 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 10J7W4SN004403; Tue, 19 Jan 2021 07:36:34 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma01wdc.us.ibm.com with ESMTP id 363qs8vgxf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Jan 2021 07:36:34 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 10J7aXQL33423776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Jan 2021 07:36:33 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 573B42805E; Tue, 19 Jan 2021 07:36:33 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 877EE2805C; Tue, 19 Jan 2021 07:36:32 +0000 (GMT) Received: from sofia.ibm.com (unknown [9.79.213.81]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 19 Jan 2021 07:36:32 +0000 (GMT) Received: by sofia.ibm.com (Postfix, from userid 1000) id 01E2F2E2EE0; Tue, 19 Jan 2021 13:06:27 +0530 (IST) From: "Gautham R. Shenoy" To: Michael Ellerman , Nathan Lynch , Srikar Dronamraju Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, "Gautham R. Shenoy" Subject: [PATCH 0/2] powerpc/cacheinfo: Add "ibm,thread-groups" awareness Date: Tue, 19 Jan 2021 13:06:18 +0530 Message-Id: <1611041780-8640-1-git-send-email-ego@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343,18.0.737 definitions=2021-01-19_01:2021-01-18,2021-01-19 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxscore=0 spamscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 phishscore=0 malwarescore=0 mlxlogscore=860 clxscore=1015 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101190044 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Gautham R. Shenoy" Hi, Currently the cacheinfo code on powerpc indexes the "cache" objects (modelling the L1/L2/L3 caches) where the key is device-tree node corresponding to that cache. On some of the POWER server platforms thread-groups within the core share different sets of caches (Eg: On SMT8 POWER9 systems, threads 0,2,4,6 of a core share L1 cache and threads 1,3,5,7 of the same core share another L1 cache). On such platforms, there is a single device-tree node corresponding to that cache and the cache-configuration within the threads of the core is indicated via "ibm,thread-groups" device-tree property. Since the current code is not aware of the "ibm,thread-groups" property, on the aforementoined systems, cacheinfo code still treats all the threads in the core to be sharing the cache because of the single device-tree node (In the earlier example, the cacheinfo code would says CPUs 0-7 share L1 cache). In this patch series, we make the powerpc cacheinfo code aware of the "ibm,thread-groups" property. We indexe the "cache" objects by the key-pair (device-tree node, thread-group id). For any CPUX, for a given level of cache, the thread-group id is defined to be the first CPU in the "ibm,thread-groups" cache-group containing CPUX. For levels of cache which are not represented in "ibm,thread-groups" property, the thread-group id is -1. We can now remove the helper function get_shared_cpu_map() and index_dir_to_cpu() since the cache->shared_cpu_map contains the correct satate of the thread-siblings sharing the cache. This has been tested on a SMT8 POWER9 system where L1 cache is split between groups of threads in the core and on an SMT8 POWER10 system where L1 and L2 caches are split between groups of threads in a core. With this patch series, on POWER10 SMT8 system, we see the following reported via sysfs: $ grep . /sys/devices/system/cpu/cpu[89]/cache/index[0123]/shared_cpu_list /sys/devices/system/cpu/cpu8/cache/index0/shared_cpu_list:8,10,12,14 /sys/devices/system/cpu/cpu8/cache/index1/shared_cpu_list:8,10,12,14 /sys/devices/system/cpu/cpu8/cache/index2/shared_cpu_list:8,10,12,14 /sys/devices/system/cpu/cpu8/cache/index3/shared_cpu_list:8-15 /sys/devices/system/cpu/cpu9/cache/index0/shared_cpu_list:9,11,13,15 /sys/devices/system/cpu/cpu9/cache/index1/shared_cpu_list:9,11,13,15 /sys/devices/system/cpu/cpu9/cache/index2/shared_cpu_list:9,11,13,15 /sys/devices/system/cpu/cpu9/cache/index3/shared_cpu_list:8-15 $ ppc64_cpu --smt=4 $ grep . /sys/devices/system/cpu/cpu[89]/cache/index[0123]/shared_cpu_list /sys/devices/system/cpu/cpu8/cache/index0/shared_cpu_list:8,10 /sys/devices/system/cpu/cpu8/cache/index1/shared_cpu_list:8,10 /sys/devices/system/cpu/cpu8/cache/index2/shared_cpu_list:8,10 /sys/devices/system/cpu/cpu8/cache/index3/shared_cpu_list:8-11 /sys/devices/system/cpu/cpu9/cache/index0/shared_cpu_list:9,11 /sys/devices/system/cpu/cpu9/cache/index1/shared_cpu_list:9,11 /sys/devices/system/cpu/cpu9/cache/index2/shared_cpu_list:9,11 /sys/devices/system/cpu/cpu9/cache/index3/shared_cpu_list:8-11 $ ppc64_cpu --smt=2 $ grep . /sys/devices/system/cpu/cpu[89]/cache/index[0123]/shared_cpu_list /sys/devices/system/cpu/cpu8/cache/index0/shared_cpu_list:8 /sys/devices/system/cpu/cpu8/cache/index1/shared_cpu_list:8 /sys/devices/system/cpu/cpu8/cache/index2/shared_cpu_list:8 /sys/devices/system/cpu/cpu8/cache/index3/shared_cpu_list:8-9 /sys/devices/system/cpu/cpu9/cache/index0/shared_cpu_list:9 /sys/devices/system/cpu/cpu9/cache/index1/shared_cpu_list:9 /sys/devices/system/cpu/cpu9/cache/index2/shared_cpu_list:9 /sys/devices/system/cpu/cpu9/cache/index3/shared_cpu_list:8-9 $ ppc64_cpu --smt=1 $ grep . /sys/devices/system/cpu/cpu[89]/cache/index[0123]/shared_cpu_list /sys/devices/system/cpu/cpu8/cache/index0/shared_cpu_list:8 /sys/devices/system/cpu/cpu8/cache/index1/shared_cpu_list:8 /sys/devices/system/cpu/cpu8/cache/index2/shared_cpu_list:8 /sys/devices/system/cpu/cpu8/cache/index3/shared_cpu_list:8 Gautham R. Shenoy (2): powerpc/cacheinfo: Lookup cache by dt node and thread-group id powerpc/cacheinfo: Remove the redundant get_shared_cpu_map() arch/powerpc/include/asm/smp.h | 3 + arch/powerpc/kernel/cacheinfo.c | 121 ++++++++++++++++++++-------------------- 2 files changed, 62 insertions(+), 62 deletions(-) -- 1.9.4