public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf_counter: Check task on counter read IPI
Date: Mon, 17 Aug 2009 11:35:23 +0200	[thread overview]
Message-ID: <1250501723.5241.1709.camel@twins> (raw)
In-Reply-To: <19081.8782.92022.727631@cargo.ozlabs.ibm.com>

On Mon, 2009-08-17 at 19:26 +1000, Paul Mackerras wrote:
> Peter Zijlstra writes:
> 
> > > I don't have an example of an actual failure due to this race, but it
> > > seems obvious that it could occur and we need to guard against it, so
> > > I think this should go in .31.
> > 
> > Hmm, right.
> > 
> > However those other sites have retry loops in the caller, but callers of
> > __perf_counter_read() do not. Granted, I'm not sure what they should
> > retry on exactly, but this patch trades an invalid update to a missing
> > update.
> 
> It relies on the counter sched-out updating ->count for all the
> counters on the task.  We know that the sched-out happened very
> recently, i.e. in the interval between deciding to send the IPI and
> the IPI arriving.  So the counter value should be sufficiently up to
> date.  Ingo pointed this out to me some time ago.
> 
> I tried to address that in the comments and the patch description but
> perhaps I wasn't explicit enough.

Or its still early and I hadn't had my morning juice yet..

Yes, you're right, in case we missed it due to a race with schedule, the
schedule action itself will have indeed updated the count and we're good
again.

So sorry for the confusion,

Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>


  reply	other threads:[~2009-08-17  9:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-14  5:39 [PATCH] perf_counter: Check task on counter read IPI Paul Mackerras
2009-08-17  8:16 ` Peter Zijlstra
2009-08-17  9:26   ` Paul Mackerras
2009-08-17  9:35     ` Peter Zijlstra [this message]
2009-08-17  9:39 ` [tip:perfcounters/urgent] " tip-bot for Paul Mackerras

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=1250501723.5241.1709.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.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