lkml.org 
[lkml]   [2022]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 20/35] mm: implement speculative handling in do_numa_page()
    Date
    change do_numa_page() to use pte_spinlock() when locking the page table,
    so that the mmap sequence counter will be validated in the speculative case.

    Signed-off-by: Michel Lespinasse <michel@lespinasse.org>
    ---
    mm/memory.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/mm/memory.c b/mm/memory.c
    index 74b51aae8166..083e015ff194 100644
    --- a/mm/memory.c
    +++ b/mm/memory.c
    @@ -4441,8 +4441,8 @@ static vm_fault_t do_numa_page(struct vm_fault *vmf)
    * validation through pte_unmap_same(). It's of NUMA type but
    * the pfn may be screwed if the read is non atomic.
    */
    - vmf->ptl = pte_lockptr(vma->vm_mm, vmf->pmd);
    - spin_lock(vmf->ptl);
    + if (!pte_spinlock(vmf))
    + return VM_FAULT_RETRY;
    if (unlikely(!pte_same(*vmf->pte, vmf->orig_pte))) {
    pte_unmap_unlock(vmf->pte, vmf->ptl);
    goto out;
    --
    2.20.1
    \
     
     \ /
      Last update: 2022-01-28 14:20    [W:3.763 / U:0.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site