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: Arnaldo Carvalho de Melo <acme@redhat.com>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org, jolsa@redhat.com,
	adrian.hunter@intel.com, mathieu.poirier@linaro.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com
Subject: Re: [PATCH v3 1/3] perf: Allow using AUX data in perf samples
Date: Mon, 04 Nov 2019 12:40:05 +0200	[thread overview]
Message-ID: <87y2wvexh6.fsf@ashishki-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20191104084024.GZ4131@hirez.programming.kicks-ass.net>

Peter Zijlstra <peterz@infradead.org> writes:

> On Mon, Oct 28, 2019 at 07:08:18PM +0200, Alexander Shishkin wrote:
>
>> > @@ -6318,11 +6318,12 @@ static void perf_aux_sample_output(struc
>> >  
>> >  	/*
>> >  	 * Guard against NMI hits inside the critical section;
>> > -	 * see also perf_aux_sample_size().
>> > +	 * see also perf_prepare_sample_aux().
>> >  	 */
>> >  	WRITE_ONCE(rb->aux_in_sampling, 1);
>> > +	barrier();
>> 
>> Isn't WRITE_ONCE() barrier enough on its own? My thinking was that we
>> only need a compiler barrier here, hence the WRITE_ONCE.
>
> WRITE_ONCE() is a volatile store and (IIRC) the compiler ensures order
> against other volatile things, but not in general.
>
> barrier() OTOH clobbers all of memory and thereby ensures nothing can
> get hoised over it.
>
> Now, the only thing we do inside this region is an indirect call, which
> on its own already implies a sync point for as long as the compiler
> cannot inline it, so it might be a bit paranoid on my end (I don't think
> even LTO can reduce this indirection and cause inlining).

I see what you mean. I was only thinking about not having to order the
AUX STOREs vs the rb->aux_in_sampling. Ordering the call itself makes
sense.

Thanks,
--
Alex

  reply	other threads:[~2019-11-04 10:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25 14:08 [PATCH v3 0/3] perf: Add AUX data sampling Alexander Shishkin
2019-10-25 14:08 ` [PATCH v3 1/3] perf: Allow using AUX data in perf samples Alexander Shishkin
2019-10-28 16:27   ` Peter Zijlstra
2019-10-28 16:28     ` Peter Zijlstra
2019-10-28 17:10       ` Alexander Shishkin
2019-10-28 17:08     ` Alexander Shishkin
2019-11-04  8:40       ` Peter Zijlstra
2019-11-04 10:40         ` Alexander Shishkin [this message]
2019-11-04 10:16   ` Peter Zijlstra
2019-11-04 12:30     ` Leo Yan
2019-11-13 10:56   ` [tip: perf/core] perf/aux: " tip-bot2 for Alexander Shishkin
2019-10-25 14:08 ` [PATCH v3 2/3] perf/x86/intel/pt: Factor out starting the trace Alexander Shishkin
2019-11-13 10:56   ` [tip: perf/core] perf/x86/intel/pt: Factor out pt_config_start() tip-bot2 for Alexander Shishkin
2019-10-25 14:08 ` [PATCH v3 3/3] perf/x86/intel/pt: Add sampling support Alexander Shishkin
2019-11-13 10:56   ` [tip: perf/core] " tip-bot2 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=87y2wvexh6.fsf@ashishki-desk.ger.corp.intel.com \
    --to=alexander.shishkin@linux.intel.com \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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

all inboxes | Powered by JetHome®