On Tue, Mar 8, 2022 at 9:26 AM Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote: > > Your actual patch looks pretty nasty, though. We avoid marking it > accessed on purpose (to avoid atomicity issues wrt hw-dirty bits etc), > but still, that patch makes me go "there has to be a better way". That better way might be to make q() not use GUP at all. It doesn't want the page - it just wants to make sure the fault is handled. For the fault_in_readable() case we already just do the user access. The only reason we don't do that for fault_in_safe_writeable() is that we don't have a good non-destructive user write. Hmm. The futex code actually uses "fixup_user_fault()" for this case. Maybe fault_in_safe_writeable() should do that? Linus