lkml.org 
[lkml]   [2023]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    Subject[PATCH v4 26/33] mm: prevent do_swap_page from handling page faults under VMA lock
    From
    Due to the possibility of do_swap_page dropping mmap_lock, abort fault
    handling under VMA lock and retry holding mmap_lock. This can be handled
    more gracefully in the future.

    Signed-off-by: Suren Baghdasaryan <surenb@google.com>
    Reviewed-by: Laurent Dufour <laurent.dufour@fr.ibm.com>
    ---
    mm/memory.c | 5 +++++
    1 file changed, 5 insertions(+)

    diff --git a/mm/memory.c b/mm/memory.c
    index 8855846a361b..af3c2c59cd11 100644
    --- a/mm/memory.c
    +++ b/mm/memory.c
    @@ -3689,6 +3689,11 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
    if (!pte_unmap_same(vmf))
    goto out;

    + if (vmf->flags & FAULT_FLAG_VMA_LOCK) {
    + ret = VM_FAULT_RETRY;
    + goto out;
    + }
    +
    entry = pte_to_swp_entry(vmf->orig_pte);
    if (unlikely(non_swap_entry(entry))) {
    if (is_migration_entry(entry)) {
    --
    2.39.2.722.g9855ee24e9-goog
    \
     
     \ /
      Last update: 2023-03-27 00:37    [W:4.122 / U:0.144 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site