Skip to contentSkip to conversation

mm-new_vma_page-cannot-see-null-vma-for-hugetlb-pages.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jan 24, 2014

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: [merged] mm-new_vma_page-cannot-see-null-vma-for-hugetlb-pages.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Fri, 24 Jan 2014 10:59:05 -0800

The patch titled
Subject: mm: new_vma_page() cannot see NULL vma for hugetlb pages
has been removed from the -mm tree. Its filename was
mm-new_vma_page-cannot-see-null-vma-for-hugetlb-pages.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Michal Hocko <[email protected]>
Subject: mm: new_vma_page() cannot see NULL vma for hugetlb pages

11c731e81bb0 ("mm/mempolicy: fix !vma in new_vma_page()") has removed BUG_ON(!vma) from new_vma_page which is partially correct because page_address_in_vma will return EFAULT for non-linear mappings and at least shared shmem might be mapped this way.

The patch also tried to prevent NULL ptr for hugetlb pages which is not correct AFAICS because hugetlb pages cannot be mapped as VM_NONLINEAR and other conditions in page_address_in_vma seem to be legit and catch real bugs.

This patch restores BUG_ON for PageHuge to catch potential issues when the to-be-migrated page is not setup properly.

---

 mm/mempolicy.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
mm/mempolicy.c renamed from mm/mempolicy.c~mm-new_vma_page-cannot-see-null-vma-for-hugetlb-pages +2 -4
diff -puN mm/mempolicy.c~mm-new_vma_page-cannot-see-null-vma-for-hugetlb-pages mm/mempolicy.c
@@ -1199,10 +1199,8 @@ static struct page *new_vma_page(struct
 	}
 
 	if (PageHuge(page)) {
-		if (vma)
-			return alloc_huge_page_noerr(vma, address, 1);
-		else
-			return NULL;
+		BUG_ON(!vma);
+		return alloc_huge_page_noerr(vma, address, 1);
 	}
 	/*
 	 * if !vma, alloc_page_vma() will use task or system default policy

_

Patches currently in -mm which might be from [email protected] are

origin.patch mm-page_alloc-allow-__gfp_nofail-to-allocate-below-watermarks-after-reclaim.patch memcg-do-not-hang-on-oom-when-killed-by-userspace-oom-access-to-memory-reserves.patch mm-vmscan-respect-numa-policy-mask-when-shrinking-slab-on-direct-reclaim.patch mm-vmscan-move-call-to-shrink_slab-to-shrink_zones.patch mm-vmscan-remove-shrink_control-arg-from-do_try_to_free_pages.patch