mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	x86@kernel.org, Borislav Petkov <bp@alien8.de>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org, vince@deater.net,
	eranian@google.com, Arnaldo Carvalho de Melo <acme@infradead.org>
Subject: Re: [PATCH 2/2] perf: Disable the event on a truncated AUX record
Date: Wed, 11 May 2016 12:41:27 +0300	[thread overview]
Message-ID: <874ma5ue2g.fsf@ashishki-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20160511091333.GA3190@twins.programming.kicks-ass.net>

Peter Zijlstra <peterz@infradead.org> writes:

> On Tue, May 10, 2016 at 04:18:33PM +0300, Alexander Shishkin wrote:
>> When the PMU driver reports a truncated AUX record, it effectively means
>> that there is no more usable room in the event's AUX buffer (even though
>> there may still be some room, so that perf_aux_output_begin() doesn't take
>> action). At this point the consumer still has to be woken up and the event
>> has to be disabled, otherwise the event will just keep spinning between
>> perf_aux_output_begin() and perf_aux_output_end() until its context gets
>> unscheduled.
>> 
>> Again, for cpu-wide events this means never, so once in this condition,
>> they will be forever losing data.
>> 
>> Fix this by disabling the event and waking up the consumer in case of a
>> truncated AUX record.
>
>> +	if (wakeup) {
>> +		if (truncated)
>> +			handle->event->pending_disable = 1;
>> +		perf_output_wakeup(handle);
>> +	}
>
> Does the userspace tool know how to deal with this and re-enable it?

Yes, it knows to ioctl(EVENT_ENABLE). Also, we're already doing the
disabling for the no-room-in-buffer condition in
perf_aux_output_begin().

Regards,
--
Alex

  reply	other threads:[~2016-05-11  9:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10 13:18 [PATCH 0/2] perf, pt: Fix massive data losses Alexander Shishkin
2016-05-10 13:18 ` [PATCH 1/2] perf/x86/intel/pt: Generate PMI in the STOP region as well Alexander Shishkin
2016-05-12 10:34   ` [tip:perf/core] " tip-bot for Alexander Shishkin
2016-05-12 12:28     ` Alexander Shishkin
2016-05-12 12:47       ` Ingo Molnar
2016-05-12 13:03         ` Alexander Shishkin
2016-05-12 12:48   ` [tip:perf/urgent] " tip-bot for Alexander Shishkin
2016-05-17  7:31     ` Alexander Shishkin
2016-05-17  8:40       ` Ingo Molnar
2016-05-21  5:25         ` Greg KH
2016-05-10 13:18 ` [PATCH 2/2] perf: Disable the event on a truncated AUX record Alexander Shishkin
2016-05-11  9:13   ` Peter Zijlstra
2016-05-11  9:41     ` Alexander Shishkin [this message]
2016-05-11  9:49       ` Peter Zijlstra
2016-05-11 10:05         ` Alexander Shishkin
2016-05-12 10:35   ` [tip:perf/core] perf/core: " tip-bot for Alexander Shishkin
2016-05-12 12:49   ` [tip:perf/urgent] " tip-bot for Alexander Shishkin

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=874ma5ue2g.fsf@ashishki-desk.ger.corp.intel.com \
    --to=alexander.shishkin@linux.intel.com \
    --cc=acme@infradead.org \
    --cc=bp@alien8.de \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=vince@deater.net \
    --cc=x86@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome