Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1651335ybz; Thu, 23 Apr 2020 03:06:50 -0700 (PDT) X-Google-Smtp-Source: APiQypIJwijegjboeCTasrWvRWUexT5vuorOXGNkNjT4cvm48hW/WZHVe7IkD40BtrYIxw5SmYHe X-Received: by 2002:a17:906:5287:: with SMTP id c7mr2026766ejm.141.1587636410172; Thu, 23 Apr 2020 03:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587636410; cv=none; d=google.com; s=arc-20160816; b=QKhSEXmxHsKyak6VlTI0psnn8XBjmQErzECHEc7o/jzd4l3kSC8FwTZSblPgMcyGi0 DlQSQ7FBMfaB5GOfgWd+7Ur/jfTouLgIl/Oaaw8qERZZtVFfKKnFU++/6dZqazS+yD6A J625VyMQ2oFuzXiYJWlYf1+Z+hYR65NXXie4YyNDnSG8p12TafEBG2vYmHMOE4bKZRJZ fgmPQqUe6bfMOcgRX4R3qpwNTPmckLDVTfjukN80zJgaVSlkUEwCro2VLwjHAqp2/wKM fjH+fw3utdsnBkBya0dBzMVlQar1vOu7AmA4oL+nJT302YhrB8bB9soeNbXQWAJvekH4 5IKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date; bh=3VZcfvCm6o+jZYZF/E8QhTaq7JuHMzEUuKEljf3TmE8=; b=H/73lWqsB+hSNyqz+pBrc0mKKBT1q4MbbDC+j+cT6+05rHuHilwvtNMWJEbblhYG7r 8H/LRzq+O6EJgJ63hU0i1xeOref/x7g5h2ic0MNybe8WxlyPoFCAkxsP6cmj1wU4mgt3 0B3wAwyqKwU4HgtaNp2izG/cnBg3vbjn1CIIzWFuhH612N2BAZKten96x3RPD6pZJ805 eu4bKDmjTVgomlRREZyP/FuebMhpgNBZeJd5Z5tkuJlWFdW96VjWZSCTbSBGexj4SRQ0 wMKPZ7Lhn421GoP+xd1CAVkHnQg4tPWft2z5LgiLvbbalBTQNcTpqu9DptZ/CxOTISjy RIzg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 dn8si879082edb.142.2020.04.23.03.06.26; Thu, 23 Apr 2020 03:06:50 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726643AbgDWKCc (ORCPT + 99 others); Thu, 23 Apr 2020 06:02:32 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:55844 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725863AbgDWKCc (ORCPT ); Thu, 23 Apr 2020 06:02:32 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03NA1obY041578; Thu, 23 Apr 2020 06:02:23 -0400 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0b-001b2d01.pphosted.com with ESMTP id 30k3xu8pt7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Apr 2020 06:02:22 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 03NA1IxE011806; Thu, 23 Apr 2020 10:02:22 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma04wdc.us.ibm.com with ESMTP id 30fs66rjyb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Apr 2020 10:02:22 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03NA2Lu051183928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Apr 2020 10:02:21 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4FC4A13604F; Thu, 23 Apr 2020 10:02:21 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B5A613605D; Thu, 23 Apr 2020 10:02:20 +0000 (GMT) Received: from sofia.ibm.com (unknown [9.199.35.140]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 23 Apr 2020 10:02:20 +0000 (GMT) Received: by sofia.ibm.com (Postfix, from userid 1000) id 6E5122E301B; Thu, 23 Apr 2020 15:32:13 +0530 (IST) Date: Thu, 23 Apr 2020 15:32:13 +0530 From: Gautham R Shenoy To: Tyrel Datwyler Cc: "Gautham R. Shenoy" , Nathan Lynch , Michael Ellerman , Vaidyanathan Srinivasan , Kamalesh Babulal , "Naveen N. Rao" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 0/5] Track and expose idle PURR and SPURR ticks Message-ID: <20200423100213.GA23192@in.ibm.com> Reply-To: ego@linux.vnet.ibm.com References: <1586249263-14048-1-git-send-email-ego@linux.vnet.ibm.com> <04b5e2fa-089f-93c9-cde9-33a930455bb2@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <04b5e2fa-089f-93c9-cde9-33a930455bb2@linux.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-23_07:2020-04-22,2020-04-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 mlxscore=0 impostorscore=0 adultscore=0 priorityscore=1501 bulkscore=0 clxscore=1015 malwarescore=0 mlxlogscore=999 lowpriorityscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004230073 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 20, 2020 at 03:46:35PM -0700, Tyrel Datwyler wrote: > On 4/7/20 1:47 AM, Gautham R. Shenoy wrote: > > 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 > > > > Reviewed-by: Tyrel Datwyler Thanks for reviewing the patches. > > Any chance this is going to be merged in the near future? There is a patchset to > update lparstat in the powerpc-utils package to calculate PURR/SPURR cpu > utilization that I would like to merge, but have been holding off to make sure > we are synced with this proposed patchset. Michael, could you please consider this for 5.8 ? -- Thanks and Regards gautham.