Blob Blame History Raw
From: Michal Hocko <mhocko@suse.com>
Subject: [PATCH] mm, sparse: do not swamp log with huge vmemmap allocation
Patch-mainline: never, SLES specific
References: bnc#1082184, bnc#1087928

When backporting fcdaf842bd8f ("mm, sparse: do not swamp log with huge vmemmap
allocation failures") I haven't realized that the upstream code is subtly
different and it stopped zeroying allocated blocks by f7f99100d8d9 ("mm: stop
zeroing memory during allocation in vmemmap") which we do not have in our
kernels. Dropping __GFP_ZERO results in not fully initialized vmemmap page
tables and random crashes when trying to access them. Fix that by adding
__GFP_ZERO back.

Signed-off-by: Michal Hocko <mhocko@suse.com>

---
 mm/sparse-vmemmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -52,7 +52,7 @@ void * __meminit vmemmap_alloc_block(uns
 {
 	/* If the main allocator is up use that, fallback to bootmem. */
 	if (slab_is_available()) {
-		gfp_t gfp_mask = GFP_KERNEL|__GFP_REPEAT |__GFP_NOWARN;
+		gfp_t gfp_mask = GFP_KERNEL|__GFP_REPEAT |__GFP_NOWARN|__GFP_ZERO;
 		int order = get_order(size);
 		static bool warned;
 		struct page *page;