On Wed, Jul 19, 2023 at 2:16 PM Axel Rasmussen <axelrasmussen@xxxxxxxxxx> wrote: > > I think perhaps the right thing to do is to have handle_userfault() release > mmap_lock when it returns VM_FAULT_NOPAGE, and to have GUP deal with that > appropriately? But, some investigation is required to be sure that's okay to do > in the other non-GUP ways we can end up in handle_userfault(). See if making kworker special works. --- x/fs/userfaultfd.c +++ y/fs/userfaultfd.c @@ -457,6 +457,8 @@ vm_fault_t handle_userfault(struct vm_fa * close the uffd. */ ret = VM_FAULT_NOPAGE; + if (current->flags & PF_WQ_WORKER) + ret = VM_FAULT_OOM; goto out; } --