mbox series

[v2,0/5] Fix some issues when looking up hugetlb page

Message ID cover.1661240170.git.baolin.wang@linux.alibaba.com (mailing list archive)
Headers show
Series Fix some issues when looking up hugetlb page | expand

Message

Baolin Wang Aug. 23, 2022, 7:50 a.m. UTC
Hi,

On ARM64 architecture, it can support CONT-PTE/PMD size hugetlb. When
looking up hugetlb page by follow_page(), we will hold the incorrect
pte/pmd lock for the CONT-PTE/PMD size hugetlb page, which will make
the pte/pmd entry unstable even under the lock and cause some potential
race issues. So considering the CONT-PTE/PMD size hugetlb, this patch set
changes to use the correct function to get the correct pte/pmd entry lock
to make the pte/pmd entry stable.

Changes from v1:
 - Introduce a new helper to handle the CONT-PTE page.
 - Use finer grained locks for CONT-PTE/PMD entries.
 - Update some commit message.

Baolin Wang (5):
  mm/hugetlb: fix races when looking up a CONT-PTE size hugetlb page
  mm/hugetlb: use PTE page lock to protect CONT-PTE entries
  mm/hugetlb: fix races when looking up a CONT-PMD size hugetlb page
  mm/hugetlb: use PMD page lock to protect CONT-PTE entries
  mm/hugetlb: add FOLL_MIGRATION validation before waiting for a
    migration entry

 include/linux/hugetlb.h | 38 ++++++++++++++++++++++++---
 mm/gup.c                | 13 ++++++++-
 mm/hugetlb.c            | 70 ++++++++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 113 insertions(+), 8 deletions(-)