Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932697AbbDORtH (ORCPT ); Wed, 15 Apr 2015 13:49:07 -0400 Received: from mga11.intel.com ([192.55.52.93]:53922 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752252AbbDORs4 convert rfc822-to-8bit (ORCPT ); Wed, 15 Apr 2015 13:48:56 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,582,1422950400"; d="scan'208";a="680636561" From: "Liang, Kan" To: Peter Zijlstra CC: "linux-kernel@vger.kernel.org" , "mingo@kernel.org" , "acme@infradead.org" , "eranian@google.com" , "andi@firstfloor.org" Subject: RE: [PATCH V6 3/6] perf, x86: large PEBS interrupt threshold Thread-Topic: [PATCH V6 3/6] perf, x86: large PEBS interrupt threshold Thread-Index: AQHQcuOidiZLwwq4gkqqdFhVF86DmJ1N02MAgACLNcA= Date: Wed, 15 Apr 2015 17:48:39 +0000 Message-ID: <37D7C6CF3E00A74B8858931C1DB2F077017C7149@SHSMSX103.ccr.corp.intel.com> References: <1428597466-8154-1-git-send-email-kan.liang@intel.com> <1428597466-8154-4-git-send-email-kan.liang@intel.com> <20150415171432.GW23123@twins.programming.kicks-ass.net> In-Reply-To: <20150415171432.GW23123@twins.programming.kicks-ass.net> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2795 Lines: 87 > -----Original Message----- > From: Peter Zijlstra [mailto:peterz@infradead.org] > Sent: Wednesday, April 15, 2015 1:15 PM > To: Liang, Kan > Cc: linux-kernel@vger.kernel.org; mingo@kernel.org; > acme@infradead.org; eranian@google.com; andi@firstfloor.org > Subject: Re: [PATCH V6 3/6] perf, x86: large PEBS interrupt threshold > > On Thu, Apr 09, 2015 at 12:37:43PM -0400, Kan Liang wrote: > > This patch also make AUTO_RELOAD conditional on large PEBS. Auto > > reload only be enabled when fix period and large PEBS. > > What's a large PEBS? > Should be large PEBS available. !(event->attr.sample_type & ~PEBS_FREERUNNING_FLAGS) > > +++ b/arch/x86/kernel/cpu/perf_event.h > > @@ -87,6 +87,17 @@ struct amd_nb { > > #define MAX_PEBS_EVENTS 8 > > > > /* > > + * Flags PEBS can handle without an PMI. > > + * > > + * TID can only be handled by flushing at context switch. > > + */ > > +#define PEBS_FREERUNNING_FLAGS \ > > + (PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_ADDR | \ > > + PERF_SAMPLE_ID | PERF_SAMPLE_CPU | > PERF_SAMPLE_STREAM_ID | \ > > + PERF_SAMPLE_DATA_SRC | PERF_SAMPLE_IDENTIFIER | \ > > + PERF_SAMPLE_TRANSACTION) > > + > > +/* > > * A debug store configuration. > > * > > * We only support architectures that use 64bit fields. > > diff --git a/arch/x86/kernel/cpu/perf_event_intel.c > > b/arch/x86/kernel/cpu/perf_event_intel.c > > index 0a7b5ca..6c8579a 100644 > > --- a/arch/x86/kernel/cpu/perf_event_intel.c > > +++ b/arch/x86/kernel/cpu/perf_event_intel.c > > @@ -2306,7 +2306,9 @@ static int intel_pmu_hw_config(struct > perf_event *event) > > return ret; > > > > if (event->attr.precise_ip) { > > - if (!event->attr.freq) > > + /* only enable auto reload when fix period and large PEBS > */ > > + if (!event->attr.freq && > > + !(event->attr.sample_type & > ~PEBS_FREERUNNING_FLAGS)) > > event->hw.flags |= > PERF_X86_EVENT_AUTO_RELOAD; > > if (x86_pmu.pebs_aliases) > > x86_pmu.pebs_aliases(event); > > I suspect you meant the above change right? Yes. > > But this negates part of the benefit of the auto reload; where previously it > saved an MSR write for pretty much all PEBS usage it now becomes a > burden for pretty much everyone. > > Why cannot we retain the win for all PEBS users? The change tries to address your comments. https://lkml.org/lkml/2015/3/30/294 Yes, we can retain the win. If so, I think we need to introduce another flag like PERF_X86_EVENT_LARGE_PEBS and check it in pebs_is_enabled. Or just keep the previous V5 patch unchanged. Thanks, Kan -- 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/