From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D88BFC43381 for ; Sun, 17 Feb 2019 22:27:13 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7473B2173C for ; Sun, 17 Feb 2019 22:27:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7473B2173C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 442hSY5Z0HzDqKh for ; Mon, 18 Feb 2019 09:27:09 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=tyreld@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 442hQh6SfxzDqJc for ; Mon, 18 Feb 2019 09:25:32 +1100 (AEDT) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1HMJAYv044914 for ; Sun, 17 Feb 2019 17:25:30 -0500 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qqfkv1400-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 17 Feb 2019 17:25:30 -0500 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 17 Feb 2019 22:25:29 -0000 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) 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) Sun, 17 Feb 2019 22:25:27 -0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x1HMPQrF22872248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 17 Feb 2019 22:25:26 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A5C0CB205F; Sun, 17 Feb 2019 22:25:26 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E73C0B2064; Sun, 17 Feb 2019 22:25:25 +0000 (GMT) Received: from oc6857751186.ibm.com (unknown [9.80.225.63]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Sun, 17 Feb 2019 22:25:25 +0000 (GMT) Subject: Re: [PATCH] powerpc/pseries: export timebase register sample in lparcfg To: mpe@ellerman.id.au References: <1544312907-17555-1-git-send-email-tyreld@linux.vnet.ibm.com> From: Tyrel Datwyler Date: Sun, 17 Feb 2019 14:25:25 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1544312907-17555-1-git-send-email-tyreld@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19021722-0060-0000-0000-0000030CB5E4 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010616; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000280; SDB=6.01162549; UDB=6.00606934; IPR=6.00943116; MB=3.00025627; MTD=3.00000008; XFM=3.00000015; UTC=2019-02-17 22:25:28 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19021722-0061-0000-0000-00004855B181 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-17_16:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902170173 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: brking@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org, puvichakravarthy@in.ibm.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Ping? Any objections to this patch? A fix is already upstream in powerpc-utils to utilize the timebase value if available. -Tyrel On 12/08/2018 03:48 PM, Tyrel Datwyler wrote: > The Processor Utilzation of Resource Registers (PURR) provide an estimate of > resources used by a cpu thread. Section 7.6 in Book III of the ISA outlines > how to calculate the percentage of shared resources for threads using the > ratio of the PURR delta and Timebase Register delta for a sampled period. > > This calculation is currently done erroneously by the lparstat tool from the > powerpc-utils package. This patch exports the current timebase value after > we sample the PURRs and exposes it to userspace accounting tools via > /proc/ppc64/lparcfg. > > Signed-off-by: Tyrel Datwyler > --- > arch/powerpc/platforms/pseries/lparcfg.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/powerpc/platforms/pseries/lparcfg.c b/arch/powerpc/platforms/pseries/lparcfg.c > index 7944873..1ea73ec 100644 > --- a/arch/powerpc/platforms/pseries/lparcfg.c > +++ b/arch/powerpc/platforms/pseries/lparcfg.c > @@ -475,6 +475,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v) > splpar_dispatch_data(m); > > seq_printf(m, "purr=%ld\n", get_purr()); > + seq_printf(m, "tbr=%ld\n", mftb()); > } else { /* non SPLPAR case */ > > seq_printf(m, "system_active_processors=%d\n", >