[PATCH V5 01/12] perf/core: Add aux_pause, aux_resume, aux_start_paused
Andi Kleen
ak at linux.intel.com
Fri Feb 9 13:10:27 PST 2024
> The writes to rb->aux_in_pause_resume must be done
> only once. It might be possible to get away without
> WRITE_ONCE(), but really the compiler should be informed
> not to make assumptions.
What stops the NMI from firing here?
> >> + if (READ_ONCE(rb->aux_in_pause_resume))
> >> + /* Guard against NMI, NMI loses here */
> >> + goto out_restore;
<----------------------- NMI
> >> + WRITE_ONCE(rb->aux_in_pause_resume, 1);
Even if it isn't racy it needs a clear comment.
-Andi
More information about the linux-arm-kernel
mailing list