Merge 952596b08c ("mm/hugetlb: fix huge_pmd_unshare() vs GUP-fast race") into android12-5.10-lts
Steps on the way to 5.10.239 Change-Id: I21d6c348003b1f188a9cf0276d24966b0871527f Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -5526,6 +5526,13 @@ int huge_pmd_unshare(struct mm_struct *mm, struct vm_area_struct *vma,
|
||||
return 0;
|
||||
|
||||
pud_clear(pud);
|
||||
/*
|
||||
* Once our caller drops the rmap lock, some other process might be
|
||||
* using this page table as a normal, non-hugetlb page table.
|
||||
* Wait for pending gup_fast() in other threads to finish before letting
|
||||
* that happen.
|
||||
*/
|
||||
tlb_remove_table_sync_one();
|
||||
put_page(virt_to_page(ptep));
|
||||
mm_dec_nr_pmds(mm);
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user