From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756122AbcGHQhN (ORCPT ); Fri, 8 Jul 2016 12:37:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50692 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756026AbcGHQgU (ORCPT ); Fri, 8 Jul 2016 12:36:20 -0400 Date: Fri, 8 Jul 2016 18:36:16 +0200 From: Jiri Olsa To: Peter Zijlstra Cc: mingo@kernel.org, acme@kernel.org, linux-kernel@vger.kernel.org, andi@firstfloor.org, eranian@google.com, jolsa@kernel.org, torvalds@linux-foundation.org, davidcc@google.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org, kan.liang@intel.com, khandual@linux.vnet.ibm.com Subject: Re: [RFC][PATCH 1/7] perf/x86/intel: Rework the large PEBS setup code Message-ID: <20160708163616.GA2392@krava> References: <20160708133059.031522978@infradead.org> <20160708134113.290879090@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160708134113.290879090@infradead.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 08 Jul 2016 16:36:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 08, 2016 at 03:31:00PM +0200, Peter Zijlstra wrote: SNIP > /* > - * When the event is constrained enough we can use a larger > - * threshold and run the event with less frequent PMI. > + * Use auto-reload if possible to save a MSR write in the PMI. > + * This must be done in pmu::start(), because PERF_EVENT_IOC_PERIOD. > */ > - if (hwc->flags & PERF_X86_EVENT_FREERUNNING) { > - threshold = ds->pebs_absolute_maximum - > - x86_pmu.max_pebs_events * x86_pmu.pebs_record_size; > - > - if (first_pebs) > - perf_sched_cb_inc(event->ctx->pmu); > - } else { > - threshold = ds->pebs_buffer_base + x86_pmu.pebs_record_size; > - > - /* > - * If not all events can use larger buffer, > - * roll back to threshold = 1 > - */ > - if (!first_pebs && > - (ds->pebs_interrupt_threshold > threshold)) > - perf_sched_cb_dec(event->ctx->pmu); > - } hum, the original code switched back the perf_sched_cb, in case !feerunning event was detected.. I dont see it in the new code.. just the threshold update jirka