On Fri, 26 Jul 2024 15:43:20 +0200 Maciej Fijalkowski wrote: > > The _ONCE() helpers basically give you the ability to store the pointer > > to a variable on the stack, and that variable won't change behind your > > back. But the only reason to READ_ONCE(ptr->thing) something multiple > > times is to tell KCSAN that "I know what I'm doing", it just silences > > potential warnings :S > > I feel like you keep on referring to _ONCE (*) being used multiple times > which might be counter-intuitive whereas I was trying from the beginning > to explain my point that xsk pool from driver POV should get the very same > treatment as xdp prog has currently. So, either mark it as __rcu variable > and use rcu helpers or use _ONCE variants plus some sync. > > (*) Ok, if you meant from the very beginning that two READ_ONCE against > pool per single critical section is suspicious then I didn't get that, > sorry. With diff below I would have single READ_ONCE and work on that > variable for rest of the napi. Patch was actually trying to limit xsk_pool > accesses from ring struct by working on stack variable. > > Would you be okay with that? Yup! That diff makes sense, thanks!