Re: Using userfaultfd with KVM's async page fault handling causes processes to hung waiting for mmap_lock to be released

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
 	}
 
--




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux