From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753099AbbC3NyX (ORCPT ); Mon, 30 Mar 2015 09:54:23 -0400 Received: from casper.infradead.org ([85.118.1.10]:33621 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751398AbbC3NyW (ORCPT ); Mon, 30 Mar 2015 09:54:22 -0400 Date: Mon, 30 Mar 2015 15:54:10 +0200 From: Peter Zijlstra To: Kan Liang Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, acme@infradead.org, eranian@google.com, andi@firstfloor.org Subject: Re: [PATCH V5 3/6] perf, x86: large PEBS interrupt threshold Message-ID: <20150330135410.GX23123@twins.programming.kicks-ass.net> References: <1424701556-28270-1-git-send-email-kan.liang@intel.com> <1424701556-28270-4-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424701556-28270-4-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 23, 2015 at 09:25:53AM -0500, Kan Liang wrote: > +/* > + * 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) > + > @@ -683,6 +700,21 @@ void intel_pmu_pebs_enable(struct perf_event *event) > else if (event->hw.flags & PERF_X86_EVENT_PEBS_ST) > cpuc->pebs_enabled |= 1ULL << 63; > > + /* > + * When the event is constrained enough we can use a larger > + * threshold and run the event with less frequent PMI. > + */ > + if (0 && /* disable this temporarily */ > + (hwc->flags & PERF_X86_EVENT_AUTO_RELOAD) && > + !(event->attr.sample_type & ~PEBS_FREERUNNING_FLAGS)) { Why not do the FREERUNNING flags thing in intel_pmu_hw_config() when you set AUTO_RELOAD and make AUTO_RELOAD conditional on it. That way you only have a single test here. AUTO_RELOAD implies the sample_type conforms.