Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754495AbbGWRZq (ORCPT ); Thu, 23 Jul 2015 13:25:46 -0400 Received: from mga09.intel.com ([134.134.136.24]:47700 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754470AbbGWRZn (ORCPT ); Thu, 23 Jul 2015 13:25:43 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,532,1432623600"; d="scan'208";a="734306378" Date: Thu, 23 Jul 2015 10:25:43 -0700 From: Andi Kleen To: Stephane Eranian Cc: Peter Zijlstra , Kan Liang , "mingo@redhat.com" , Arnaldo Carvalho de Melo , Mark Rutland , Adrian Hunter , David Ahern , Jiri Olsa , Namhyung Kim , LKML , Andy Lutomirski Subject: Re: [PATCH RFC V2 1/1] x86, perf: Add a freq pmu driver Message-ID: <20150723172543.GQ7380@tassilo.jf.intel.com> References: <1437407346-31186-1-git-send-email-kan.liang@intel.com> <20150721095524.GK19282@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1557 Lines: 34 > I understand the value of the tsc and smi events. It is not > clear to me what aperf/mperf buys you over cycles and ref-cycles: > > $ perf stat -a -e msr/aperf/,msr/mperf/,cycles,ref-cycles -C 1 -I 1000 sleep 10 > # time counts unit events > 2.000361718 14,826,353 msr/aperf/ > 2.000361718 11,865,170 msr/mperf/ > 2.000361718 17,170,101 cycles > 2.000361718 13,629,675 ref-cycles > > Only the ratio aperf/mperf is defined, here 1.25 and the ratio > cycles/ref-cycles is 1.25 as well. So what is a situation where > aperf/mperf provides better info than cycles/ref-cycles? > The SDM also says aperf/mperf only defined when running in C0 mode. aperf/mperf excludes idle and it accounts for throttling and p-state coordination. So it's a indicator how busy the CPU is while running. That's why it is used as input to the p-state algorithm. cycles/ref-cycles is just the core busy indicator related to idle. That's a different metric. Also we have PPERF now on some parts (productive performance count), but it also needs a ratio, so MPERF is needed to get the ratio. BTW with the table driven scheme adding new MSRs is very cheap (just a table entry usually) so there is little reason for not adding any. -Andi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/