Thread (23 messages) read the whole thread 23 messages, 2 authors, 2024-05-15

Re: [PATCH V5 01/12] perf/core: Add aux_pause, aux_resume, aux_start_paused

From: Andi Kleen <hidden>
Date: 2024-02-09 21:10:29
Also in: linux-perf-users, lkml

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?
quoted
quoted
+  if (READ_ONCE(rb->aux_in_pause_resume))
+	/* Guard against NMI, NMI loses here */
+          goto out_restore;
<----------------------- NMI
quoted
quoted
+  WRITE_ONCE(rb->aux_in_pause_resume, 1);

Even if it isn't racy it needs a clear comment.

-Andi



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help