aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index c41b2a0ee273..8874c8ad55aa 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3278,6 +3278,15 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
3278 struct page *page; 3278 struct page *page;
3279 3279
3280 /* 3280 /*
3281 * If we have a pending SIGKILL, don't keep faulting pages and
3282 * potentially allocating memory.
3283 */
3284 if (unlikely(fatal_signal_pending(current))) {
3285 remainder = 0;
3286 break;
3287 }
3288
3289 /*
3281 * Some archs (sparc64, sh*) have multiple pte_ts to 3290 * Some archs (sparc64, sh*) have multiple pte_ts to
3282 * each hugepage. We have to make sure we get the 3291 * each hugepage. We have to make sure we get the
3283 * first, for the page indexing below to work. 3292 * first, for the page indexing below to work.
@@ -3735,8 +3744,7 @@ retry:
3735 if (!pmd_huge(*pmd)) 3744 if (!pmd_huge(*pmd))
3736 goto out; 3745 goto out;
3737 if (pmd_present(*pmd)) { 3746 if (pmd_present(*pmd)) {
3738 page = pte_page(*(pte_t *)pmd) + 3747 page = pmd_page(*pmd) + ((address & ~PMD_MASK) >> PAGE_SHIFT);
3739 ((address & ~PMD_MASK) >> PAGE_SHIFT);
3740 if (flags & FOLL_GET) 3748 if (flags & FOLL_GET)
3741 get_page(page); 3749 get_page(page);
3742 } else { 3750 } else {