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]

 



Hi,

From my side, I managed to avoid the freezing of processes with the following change in function userfaultfd_release() in file fs/userfaultfd.c (https://elixir.bootlin.com/linux/v5.13/source/fs/userfaultfd.c#L842):

I moved the following command from line 851:
WRITE_ONCE(ctx->released, true);
(https://elixir.bootlin.com/linux/v5.13/source/fs/userfaultfd.c#L851)

to line 905, that is exactly before the functions returns 0.

That simple workaround worked for my use case but I am far from sure that is a correct/sufficient fix for the problem at hand.

Best Regards,
Dimitris

Στις 07/03/2025 10:07, Jinjiang Tu έγραψε:
cc Peter Xu

在 2025/3/7 15:21, Jinjiang Tu 写道:
Hi,

I encountered the same issue too. In my scenario, GUP is called by mlockall()
syscall.

Is there a solution to fix it?

Thanks.





[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