All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Vince Weaver <vince@deater.net>, Ingo Molnar <mingo@kernel.org>
Subject: Re: [RFC] perf/x86/intel: Account interrupts for PEBS errors
Date: Wed, 14 Dec 2016 19:07:30 +0100	[thread overview]
Message-ID: <20161214180730.GR3124@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20161214165036.GB9180@krava>

On Wed, Dec 14, 2016 at 05:50:36PM +0100, Jiri Olsa wrote:
> 
> I also fail to reproduce on other than snb_x (model 45) server

reproduces on my ivb-ep as well model 62.

> thoughts?

cute find :-)

> +++ b/arch/x86/events/intel/ds.c
> @@ -1389,9 +1389,13 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs)
>  			continue;
>  
>  		/* log dropped samples number */
> -		if (error[bit])
> +		if (error[bit]) {
>  			perf_log_lost_samples(event, error[bit]);
>  
> +			if (perf_event_account_interrupt(event, 1))

Seems a bit daft to expose the .throttle argument, since that would be
the only point of calling this.




> +static int __perf_event_overflow(struct perf_event *event,
> +				   int throttle, struct perf_sample_data *data,
> +				   struct pt_regs *regs)
> +{
> +	int events = atomic_read(&event->event_limit);
> +	struct hw_perf_event *hwc = &event->hw;
> +	int ret = 0;
> +
> +	/*
> +	 * Non-sampling counters might still use the PMI to fold short
> +	 * hardware counters, ignore those.
> +	 */
> +	if (unlikely(!is_sampling_event(event)))
> +		return 0;
> +
> +	ret = perf_event_account_interrupt(event, throttle);
> +
>  	if (event->attr.freq) {
>  		u64 now = perf_clock();
>  		s64 delta = now - hwc->freq_time_stamp;

Arguably, everything in __perf_event_overflow() except for calling of
->overflow_handler() should be done I think.

  reply	other threads:[~2016-12-14 18:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14 16:50 [RFC] perf/x86/intel: Account interrupts for PEBS errors Jiri Olsa
2016-12-14 18:07 ` Peter Zijlstra [this message]
2016-12-14 18:16   ` Jiri Olsa
2016-12-14 19:32     ` Peter Zijlstra
2016-12-15  7:14       ` Jiri Olsa
2016-12-15 15:43       ` [PATCHv2] " Jiri Olsa
2016-12-15 23:41         ` kbuild test robot
2016-12-16  8:07           ` [PATCHv3] " Jiri Olsa
2016-12-16  1:37         ` [PATCHv2] " Vince Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161214180730.GR3124@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=vince@deater.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.