Re: [PATCH 3/3] events: Ensure that timers are updated withoutrequiring read() call

From: Peter Zijlstra
Date: Fri Jun 24 2011 - 05:47:17 EST


On Fri, 2011-06-24 at 11:44 +0200, Peter Zijlstra wrote:
> > + calc_timer_values(event,
> > + &event->total_time_enabled,
> > + &event->total_time_running);
>
> I'm not sure writing those from NMI context is a sane thing to do, best
> is to compute the values into a local variable and use that variable
> below.

To clarify, on 32bit architectures the NMI might come in the middle of
writing the two words of one of those, writing them again from the NMI
handler will result in overlapping writes, which might lead to some
weird end-results.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/