[lkml]   [2009]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] perf_counter: Check task on counter read IPI
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.


 \ /
  Last update: 2009-08-17 11:29    [W:0.072 / U:0.300 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site