lkml.org 
[lkml]   [2010]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] sched_clock: Provide local_clock() and improve documentation
From
Date
On Fri, 2010-05-28 at 11:11 -0700, Chad Talbott wrote:
> On Fri, May 28, 2010 at 6:13 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> > + * local_clock() -- is cpu_clock() on the current cpu.
>
> Pretty sure this should read, "is cpu_clock() on *some* cpu," since
> there is no guarantee in a preemptible kernel that local_clock()
> returns on the same CPU that it was called from. The caller has to do
> the preempt protection itself.

Current cpu simply has no meaning if preemption isn't disabled. If it
is, it has and the result is useful.

Some of the local_clock() users are strictly per-cpu (and clearly have
preemption disabled), for some there simply is no better clock and
simply cope with the small incoherency in time.





\
 
 \ /
  Last update: 2010-05-28 20:25    [W:2.264 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site