Patchwork [54/72] sched_clock: Prevent 64bit inatomicity on
32bit systems  mail settings Submitter Luis Henriques Date April
18, 2013, 9:16 a.m. Message ID <> Download mbox | patch
Permalink /patch/237553/ State New Headers show   Luis Henriques
- April 18, 2013, 9:16 a.m. -stable review patch.  If anyone has
any objections, please let me know.   From: Thomas Gleixner <>
commit a1cbcaa9ea87b87a96b9fc465951dcf36e459ca2 upstream.  The
sched_clock_remote() implementation has the following
inatomicity problem on 32bit systems when accessing the remote
scd->clock, which is a 64bit value.   sched_clock_local()
sched_clock_remote(CPU0)                         remote_clock =
scd[CPU0]->clock  While the update of scd->clock is using an
atomic64 mechanism, the readout on the remote cpu is not, which
can cause completely bogus  It is a quite rare problem, because
it requires the update to hit the narrow race window between the
low/high readout and the update must go across the 32bit
boundary.  The resulting misbehaviour is, that CPU1 will