aboutsummaryrefslogtreecommitdiffstats
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r--mm/huge_memory.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index ae2bf08b1099..37e89a32a0b1 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -923,6 +923,31 @@ int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
923 return ret; 923 return ret;
924} 924}
925 925
926int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
927 unsigned long addr, unsigned long end,
928 unsigned char *vec)
929{
930 int ret = 0;
931
932 spin_lock(&vma->vm_mm->page_table_lock);
933 if (likely(pmd_trans_huge(*pmd))) {
934 ret = !pmd_trans_splitting(*pmd);
935 spin_unlock(&vma->vm_mm->page_table_lock);
936 if (unlikely(!ret))
937 wait_split_huge_page(vma->anon_vma, pmd);
938 else {
939 /*
940 * All logical pages in the range are present
941 * if backed by a huge page.
942 */
943 memset(vec, 1, (end - addr) >> PAGE_SHIFT);
944 }
945 } else
946 spin_unlock(&vma->vm_mm->page_table_lock);
947
948 return ret;
949}
950
926pmd_t *page_check_address_pmd(struct page *page, 951pmd_t *page_check_address_pmd(struct page *page,
927 struct mm_struct *mm, 952 struct mm_struct *mm,
928 unsigned long address, 953 unsigned long address,