Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7868671ybi; Tue, 9 Jul 2019 05:39:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlVrrxtBiw2czwFtRXaUjX7N01mRHTGVeettH0SHdCKv5fjEhosq41QoaTjYkQLEGn8FnY X-Received: by 2002:a17:90a:2343:: with SMTP id f61mr33127484pje.130.1562675967371; Tue, 09 Jul 2019 05:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562675967; cv=none; d=google.com; s=arc-20160816; b=AqoI8MQmnKd5AhcOz4CpW+gIDYu9KrQs6bhL3P4uz/VlPVq8whkiRdL9w0SdF68Sn8 Nsr1j7oWdE0rpfO/YvXnE/NoJIrogZYkn0eVsoe1cmDUgkjWLEZPMbKfC/+AjlDexhbe ci5iZ0cygWa6CO5ulwvjPs1NFA4Ju1ZnYNZTeV+bG3NpzymqH4twds/XXTlmfsrr/nPp h0/e4sEtVaoSkXOOMzlFTGqgjxI6bjDEeeeOht4TsY30rab7kMyrdaZieLZX95YhRZEp 8TAYDIxIG2kTZvUHoK2hOOFDJKkVcvRdUTxjv1UPrZ43U4rrRciWC1Q8w21oYkZ9UELT jnBA== 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:message-id:subject:cc :to:from:date:dkim-signature; bh=AkO0qGwBqpTh3ze3nd2E/zoDfg+sbnDSZsXsHUXKFtg=; b=0pIH67GVIzT6IXWMJBfV20Q5iRl7ZDlUCqgPc/YDPw8IRHK7AZQuS3lV116iqkiZxb kG0TohKvAYIXJjsJJOXQo+tREeQW/kbkahyo3iPw7cMysfQhDAkmiAt0jC2+R0a8z1Hw 9jA3P1jTwU1zq6/qecNvjIVPGl0qZ/IVyUkM1iqCXrddh3E+uuUp2lcTSAqEqMiIF6Vw oc5F/MATrCPjigQJVUhGYyu5C+E34cOpEOQ+m8UVg09KT0rQvUMWr94WNb3jMJiskKBs LywXwcISm8kfUH21yXr1gzcu1njdY5/4Bfm0HJ+wFFlBFZE7jNE/Ne5vuIoqrlDFdvzG Abzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=OWdldj2r; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e19si2458869pjp.49.2019.07.09.05.39.11; Tue, 09 Jul 2019 05:39:27 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=OWdldj2r; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726684AbfGIMix (ORCPT + 99 others); Tue, 9 Jul 2019 08:38:53 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38066 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbfGIMiw (ORCPT ); Tue, 9 Jul 2019 08:38:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=AkO0qGwBqpTh3ze3nd2E/zoDfg+sbnDSZsXsHUXKFtg=; b=OWdldj2rR1D83RUzoQFzQwo+N SByCu3cdtGi001/bgVfqRlgTrBDcgrjzSQs/YLoiPSGYfq6krg67DuRugNqfrTEdFd6U+hcDSY3D3 y+rc4wioob7F3xhuP3+/xf5lSlr2i1HzOawA/XBf7xt/lUtwLxMRbeG35j7p8WFbHf2yoe/VVWAXi 9koVK59wRHHDlxBJCNajnyat0t7vtgSk7sAZHzB1Hghtk3IqSlhx1wakdBc8eFNFDFhzBh7r4KRwU fRnHa79TK7gHM7zDvIvJ0PD0nOvVot3XTzfOBX8vlyaJL9vRgNjJw/SGEZnPqe6VxsyrtgfhCflaX 4QQy/+OeA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hkpOK-0006bA-Ic; Tue, 09 Jul 2019 12:38:40 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6AA4720976D9C; Tue, 9 Jul 2019 14:38:38 +0200 (CEST) Date: Tue, 9 Jul 2019 14:38:38 +0200 From: Peter Zijlstra To: Ankur Arora Cc: Thomas Gleixner , "Raslan, KarimAllah" , "boris.ostrovsky@oracle.com" , "joao.m.martins@oracle.com" , "konrad.wilk@oracle.com" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "rkrcmar@redhat.com" , "pbonzini@redhat.com" , "kernellwp@gmail.com" , "mtosatti@redhat.com" Subject: Re: cputime takes cstate into consideration Message-ID: <20190709123838.GA3402@hirez.programming.kicks-ass.net> References: <20190626145413.GE6753@char.us.oracle.com> <1561575536.25880.10.camel@amazon.de> <7f721d94-aa19-20a4-6930-9ed4d1cd4834@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7f721d94-aa19-20a4-6930-9ed4d1cd4834@oracle.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 08, 2019 at 07:00:08PM -0700, Ankur Arora wrote: > 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. That would fully claim PT just for this stupid accounting thing and be completely Intel specific. Just stop this madness already.