Re: [PATCH 2/2] More precise timestamps for nested writes

Peter Zijlstra
2015-04-14T17:13:50Z

On Mon, Apr 13, 2015 at 09:38:01PM -0500, Suresh E. Warrier wrote:
> +static u64 *get_write_timestamp(struct ring_buffer_per_cpu *cpu_buffer,
> + unsigned long *flags)
> +{
> + if (rb_precise_nested_write_ts()) {
> + /*
> + * Ensure that we are not preempted until after we update
> + * the write timestamp.
> + */
> + local_irq_save(*flags);
> + return &cpu_buffer->last_stamp;

Yeah, ever hear about NMIs? This isn't going to work.

> + } else {
> + return &cpu_buffer->write_stamp;
> + }
> +}