Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4158185ybb; Tue, 7 Apr 2020 01:48:56 -0700 (PDT) X-Google-Smtp-Source: APiQypLyubv4MhnprO6ayNvfYOEKimBphnPH3kmMZ39jYiSCmn7MyAjw4wlh3NNoIPMDqiupLL7F X-Received: by 2002:aca:3c82:: with SMTP id j124mr866357oia.89.1586249336665; Tue, 07 Apr 2020 01:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586249336; cv=none; d=google.com; s=arc-20160816; b=f4uMtagevn9YKI6HtYWA4qmr7dyy52Q9ZhTwjsqal19FZ7fV/q3F9cnLJ3YC9AmHUx 8IVTIN95YPxgH9Wj4oqlXCDlp7j6ShfrICPSOKXN1NihJfVPY6Y3itrpg06bqRV2Emro GPfIPE3UvjXLSSZfxTbAjpRAmMpVJhhJHPmYcxRArJbiEB6GYjDtyi/w7PIQnwd1t0Qa 2WHlyh8JM7nNg1lGYVeDWHhJQxxPt1pWzyvBjq28PaS1t9BLdenmadysYNEe6R+TWqxs Yr7qC7X0qGuWzmG5eZxPToMwlpZH8+l/QYsC+FpTa1ptStk6nshuA3F++n3wh0tMNf2Q ttYw== 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; bh=GAocy3MZwSrjVWrScTPUE5vxKAl2RDnRoi+fq+e083A=; b=SLZcnnVUBKGCoOK4LZGhw2+Ozvc20OQ8oFxz95nyAHFCRyE61ngXyfEO6p3Kld7whj M98Hu+4z1XldDFJe3tky/wRFbxuuHfjXx3gGXO6UmciqA5s0CpVWDRaIRGIPI1EL8Lwz k2wJzCB4Gfj8AujfBUOOFwWiUVUUSL+yrW0NTfbgtRyS2no/Uo5dWvsGe2Ic+vTXgYLr 5YeFHtTXjZ8CmoBE5y1Amk1CDXenILNLB7jE77ZDhdm0GbpZbMzZ6S/StuS2sxJcOblR 3of4XsvPonhxmhZpQyjOLc61vBlDnSQifOERASO6ZlXu/krKM8XHzQtNh4zpVIXbkKT9 CNbA== 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 x1si917278otq.201.2020.04.07.01.48.43; Tue, 07 Apr 2020 01:48:56 -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 S1728016AbgDGIsN (ORCPT + 99 others); Tue, 7 Apr 2020 04:48:13 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:27774 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbgDGIsN (ORCPT ); Tue, 7 Apr 2020 04:48:13 -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 0378XIHl135959; Tue, 7 Apr 2020 04:48:05 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 3082hx98mq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Apr 2020 04:48:05 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 0378iAvs026111; Tue, 7 Apr 2020 08:48:04 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma03dal.us.ibm.com with ESMTP id 306hv6mbtf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Apr 2020 08:48:04 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0378m3J149349104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Apr 2020 08:48:03 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8A53AC605D; Tue, 7 Apr 2020 08:48:03 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DA2F8C605A; Tue, 7 Apr 2020 08:48:02 +0000 (GMT) Received: from sofia.ibm.com (unknown [9.79.178.96]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 7 Apr 2020 08:48:02 +0000 (GMT) Received: by sofia.ibm.com (Postfix, from userid 1000) id D58072E3219; Tue, 7 Apr 2020 14:17:58 +0530 (IST) From: "Gautham R. Shenoy" To: Nathan Lynch , Michael Ellerman , Vaidyanathan Srinivasan , Kamalesh Babulal , "Naveen N. Rao" , Tyrel Datwyler Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, "Gautham R. Shenoy" Subject: [PATCH v5 0/5] Track and expose idle PURR and SPURR ticks Date: Tue, 7 Apr 2020 14:17:38 +0530 Message-Id: <1586249263-14048-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.138,18.0.676 definitions=2020-04-07_01:2020-04-07,2020-04-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 adultscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004070072 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Gautham R. Shenoy" Hi, This is the fifth version of the patches to track and expose idle PURR and SPURR ticks. These patches are required by tools such as lparstat to compute system utilization for capacity planning purposes. The previous versions can be found here: v4: https://lkml.org/lkml/2020/3/27/323 v3: https://lkml.org/lkml/2020/3/11/331 v2: https://lkml.org/lkml/2020/2/21/21 v1: https://lore.kernel.org/patchwork/cover/1159341/ They changes from v4 are: - As suggested by Naveen, moved the functions read_this_idle_purr() and read_this_idle_spurr() from Patch 2 and Patch 3 respectively to Patch 4 where it is invoked. - Dropped Patch 6 which cached the values of purr, spurr, idle_purr, idle_spurr in order to minimize the number of IPIs sent. - Updated the dates for the idle_purr, idle_spurr in the Documentation Patch 5. Motivation: =========== On PSeries LPARs, the data centers planners desire a more accurate view of system utilization per resource such as CPU to plan the system capacity requirements better. Such accuracy can be obtained by reading PURR/SPURR registers for CPU resource utilization. Tools such as lparstat which are used to compute the utilization need to know [S]PURR ticks when the cpu was busy or idle. The [S]PURR counters are already exposed through sysfs. We already account for PURR ticks when we go to idle so that we can update the VPA area. This patchset extends support to account for SPURR ticks when idle, and expose both via per-cpu sysfs files. These patches are required for enhancement to the lparstat utility that compute the CPU utilization based on PURR and SPURR which can be found here : https://groups.google.com/forum/#!topic/powerpc-utils-devel/fYRo69xO9r4 With the patches, when lparstat is run on a LPAR running CPU-Hogs, ========================================================================= sudo ./src/lparstat -E 1 3 System Configuration type=Dedicated mode=Capped smt=8 lcpu=2 mem=4834112 kB cpus=0 ent=2.00 ---Actual--- -Normalized- %busy %idle Frequency %busy %idle ------ ------ ------------- ------ ------ 1 99.99 0.00 3.35GHz[111%] 110.99 0.00 2 100.00 0.00 3.35GHz[111%] 111.01 0.00 3 100.00 0.00 3.35GHz[111%] 111.00 0.00 With patches, when lparstat is run on and idle LPAR ========================================================================= System Configuration type=Dedicated mode=Capped smt=8 lcpu=2 mem=4834112 kB cpus=0 ent=2.00 ---Actual--- -Normalized- %busy %idle Frequency %busy %idle ------ ------ ------------- ------ ------ 1 0.15 99.84 2.17GHz[ 72%] 0.11 71.89 2 0.24 99.76 2.11GHz[ 70%] 0.18 69.82 3 0.24 99.75 2.11GHz[ 70%] 0.18 69.81 Gautham R. Shenoy (5): powerpc: Move idle_loop_prolog()/epilog() functions to header file powerpc/idle: Store PURR snapshot in a per-cpu global variable powerpc/pseries: Account for SPURR ticks on idle CPUs powerpc/sysfs: Show idle_purr and idle_spurr for every CPU Documentation: Document sysfs interfaces purr, spurr, idle_purr, idle_spurr Documentation/ABI/testing/sysfs-devices-system-cpu | 39 +++++++++ arch/powerpc/include/asm/idle.h | 93 ++++++++++++++++++++++ arch/powerpc/kernel/sysfs.c | 82 ++++++++++++++++++- arch/powerpc/platforms/pseries/setup.c | 8 +- drivers/cpuidle/cpuidle-pseries.c | 39 ++------- 5 files changed, 224 insertions(+), 37 deletions(-) create mode 100644 arch/powerpc/include/asm/idle.h -- 1.9.4