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=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 DF758C606B0 for ; Tue, 9 Jul 2019 02:01:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF11C2063F for ; Tue, 9 Jul 2019 02:01:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="kTnLdxhW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726823AbfGICBS (ORCPT ); Mon, 8 Jul 2019 22:01:18 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:42352 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726279AbfGICBR (ORCPT ); Mon, 8 Jul 2019 22:01:17 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x691xQaL151075; Tue, 9 Jul 2019 02:00:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=U2t+vwAtO3tIITUDeTKxOkzeYb9biWe96LNHTTtlwYk=; b=kTnLdxhWXDvwtHf0Z/iVaFvjD7DwuOqUOLuf4mJ1qB1ItIZtcbnOpKoiRIVqHwFClm4T 7GuMv5ClVP9jGiJBqv9x5rT9uOidsYTpJFTZPecnJArbvIn4p2L/2qzfj3y9kGjqmkUS 8mIXjXoF56650APDkXVFI3q3IjvcR55mTv+7I6ILqLseFFi/34pOfVXatXU094AqzOXW FrPNhORCg5bYsr1a9zHRxmHOW0kjm8JzPwcPghKtM7KGhBX1ycukmwSpSNVGr5TasAXl SNOQw97LpTInpH6hHAl4KwXNI3KjYS7hP3ekoPWMaizL7Zx8x8mct3keTPzDeFI/7DEb EA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 2tjm9qhdyg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 09 Jul 2019 02:00:15 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x691wUbu105527; Tue, 9 Jul 2019 02:00:14 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 2tjjykh0ef-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 09 Jul 2019 02:00:14 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x6920Aii004992; Tue, 9 Jul 2019 02:00:13 GMT Received: from [10.159.242.95] (/10.159.242.95) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Jul 2019 19:00:10 -0700 Subject: Re: cputime takes cstate into consideration To: Thomas Gleixner , "Raslan, KarimAllah" Cc: "boris.ostrovsky@oracle.com" , "joao.m.martins@oracle.com" , "konrad.wilk@oracle.com" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , "rkrcmar@redhat.com" , "pbonzini@redhat.com" , "kernellwp@gmail.com" , "mtosatti@redhat.com" References: <20190626145413.GE6753@char.us.oracle.com> <1561575536.25880.10.camel@amazon.de> From: Ankur Arora Message-ID: <7f721d94-aa19-20a4-6930-9ed4d1cd4834@oracle.com> Date: Mon, 8 Jul 2019 19:00:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9312 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907090024 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9312 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 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-1907090024 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-06-26 12:23 p.m., Thomas Gleixner wrote: > On Wed, 26 Jun 2019, Raslan, KarimAllah wrote: >> On Wed, 2019-06-26 at 10:54 -0400, Konrad Rzeszutek Wilk wrote: >>> There were some ideas that Ankur (CC-ed) mentioned to me of using the perf >>> counters (in the host) to sample the guest and construct a better >>> accounting idea of what the guest does. That way the dashboard >>> from the host would not show 100% CPU utilization. >> >> You can either use the UNHALTED cycles perf-counter or you can use MPERF/APERF >> MSRs for that. (sorry I got distracted and forgot to send the patch) > > Sure, but then you conflict with the other people who fight tooth and nail > over every single performance counter. How about using Intel PT PwrEvt extensions? This should allow us to precisely track idle residency via just MWAIT and TSC packets. Should be pretty cheap too. It's post Cascade Lake though. Ankur > > Thanks, > > tglx >