On Sun, 2021-08-15 at 11:35 +0200, Vlastimil Babka wrote: > On 8/15/21 6:17 AM, Mike Galbraith wrote: > > On Sat, 2021-08-14 at 21:08 +0200, Vlastimil Babka wrote: > > > > > > Aha! That's helpful. Hopefully it's just a small issue where we > > > opportunistically test flags on a page that's protected by the local > > > lock we didn't take yet, and I didn't realize there's the VM_BUG_ON > > > which can trigger if our page went away (which we would have realized > > > after taking the lock). > > > > Speaking of optimistic peeking perhaps going badly, why is the below > > not true? There's protection against ->partial going disappearing > > during a preemption... but can't it just as easily appear, so where is > > that protection? > > If it appears, it appears, we don't care, we just leave it there and > won't use it. > > > If the other side of that window is safe, it could use a comment so > > dummies reading this code don't end up asking mm folks why the heck > > they don't just take the darn lock and be done with it instead of tap > > dancing all around thething :) > > Well, with your patch, ->partial might appear just after the unlock, so > does that really change anything? Viewed from pov consumption is optional, it makes sense. -Mike