On Tue, Nov 07, 2023 at 03:28:12PM +0100, Eric Auger wrote: > > > On 11/7/23 15:05, Alexandru Elisei wrote: ... > > By the way, pmu_stats is not declared volatile, which means that the > > compiler is free to optimize accesses to the struct by caching previously > > read values in registers. Have you tried declaring it as volatile, in case > > that fixes the issues you were seeing? > In my case it won't fix the issue because the stats match what happens > but your suggestion makes total sense in general. > > I will add that. > We also have READ/WRITE_ONCE() in lib/linux/compiler.h Thanks, drew