Re: [RFC PATCH] sched_clock: Avoid tearing during read from NMI

2015-01-21 Thread Stephen Boyd
On 01/21/2015 09:29 AM, John Stultz wrote: > On Wed, Jan 21, 2015 at 8:53 AM, Daniel Thompson > wrote: >> Currently it is possible for an NMI (or FIQ on ARM) to come in and >> read sched_clock() whilst update_sched_clock() has half updated the >> state. This results in a bad time value being obser

Re: [RFC PATCH] sched_clock: Avoid tearing during read from NMI

2015-01-21 Thread Daniel Thompson
On 21/01/15 17:29, John Stultz wrote: > On Wed, Jan 21, 2015 at 8:53 AM, Daniel Thompson > wrote: >> Currently it is possible for an NMI (or FIQ on ARM) to come in and >> read sched_clock() whilst update_sched_clock() has half updated the >> state. This results in a bad time value being observed.

Re: [RFC PATCH] sched_clock: Avoid tearing during read from NMI

2015-01-21 Thread John Stultz
On Wed, Jan 21, 2015 at 8:53 AM, Daniel Thompson wrote: > Currently it is possible for an NMI (or FIQ on ARM) to come in and > read sched_clock() whilst update_sched_clock() has half updated the > state. This results in a bad time value being observed. > > This patch fixes that problem in a simila

[RFC PATCH] sched_clock: Avoid tearing during read from NMI

2015-01-21 Thread Daniel Thompson
Currently it is possible for an NMI (or FIQ on ARM) to come in and read sched_clock() whilst update_sched_clock() has half updated the state. This results in a bad time value being observed. This patch fixes that problem in a similar manner to Thomas Gleixner's 4396e058c52e("timekeeping: Provide f