Re: [PATCH] sched: Fix 32bit race in sched_clock_remote()

2013-04-10 Thread Peter Zijlstra
On Tue, 2013-04-09 at 22:55 +0800, Yong Zhang wrote: > > + this_clock = scd_clock_read(my_scd); > > + remote_clock = scd_clock_read(scd); >^^ >it doesn't match the declaration: > scd_read_clock(). Yeah, I'm a moron and forgot to c

Re: [PATCH] sched: Fix 32bit race in sched_clock_remote()

2013-04-09 Thread Yong Zhang
On Fri, Apr 05, 2013 at 06:36:40PM +0200, Peter Zijlstra wrote: > Thomas spotted a nasty 32bit race in sched_clock_remote() after way too > many hours of debugging weirdness. > > What happens is that sched_clock_remote() does regular machine word > reads of sched_clock_data::clock; this appears sa

Re: [PATCH] sched: Fix 32bit race in sched_clock_remote()

2013-04-08 Thread Steven Rostedt
On Fri, 2013-04-05 at 18:36 +0200, Peter Zijlstra wrote: > Thomas spotted a nasty 32bit race in sched_clock_remote() after way too > many hours of debugging weirdness. > > What happens is that sched_clock_remote() does regular machine word > reads of sched_clock_data::clock; this appears safe sinc

[PATCH] sched: Fix 32bit race in sched_clock_remote()

2013-04-05 Thread Peter Zijlstra
Thomas spotted a nasty 32bit race in sched_clock_remote() after way too many hours of debugging weirdness. What happens is that sched_clock_remote() does regular machine word reads of sched_clock_data::clock; this appears safe since we use cmpxchg64() to update the variable and any half-read value