[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dee238e365f3727ab16d6685e186c53c@cslab.ece.ntua.gr>
Date: Fri, 07 Mar 2025 15:11:09 +0200
From: jimsiak <jimsiak@...ab.ece.ntua.gr>
To: Jinjiang Tu <tujinjiang@...wei.com>
Cc: peterx@...hat.com, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, viro@...iv.linux.org.uk,
linux-mm@...ck.org, wangkefeng.wang@...wei.com
Subject: Re: Using userfaultfd with KVM's async page fault handling causes
processes to hung waiting for mmap_lock to be released
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.
>>
Powered by blists - more mailing lists