Skip to contentSkip to conversation

mm/balloon_compaction.c: don't zero ballooned pages

PATCH New [email protected] 1 participant 1 message Aug 10, 2017 Memory management

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 17/21 mm/balloon_compaction.c: don't zero ballooned pages

From: Wei Wang <[email protected]>
Subject: mm/balloon_compaction.c: don't zero ballooned pages

Revert of bb01b64cfab7 ("mm/balloon_compaction.c: enqueue zero page to balloon device")'

Zeroing ballon pages is rather time consuming, especially when a lot of pages are in flight. E.g. 7GB worth of ballooned memory takes 2.8s with __GFP_ZERO while it takes ~491ms without it.

The original commit argued that zeroing will help ksmd to merge these pages on the host but this argument is assuming that the host actually marks balloon pages for ksm which is not universally true. So we pay performance penalty for something that even might not be used in the end which is wrong. The host can zero out pages on its own when there is a need.

[[email protected]: new changelog text]
Fixes bb01b64cfab7 ("mm/balloon_compaction.c: enqueue zero page to balloon device")
Cc zhenwei.pi <[email protected]>
Cc David Hildenbrand <[email protected]>

---

 mm/balloon_compaction.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/balloon_compaction.c renamed from mm/balloon_compaction.c~mm-dont-zero-ballooned-pages +1 -1
diff -puN mm/balloon_compaction.c~mm-dont-zero-ballooned-pages mm/balloon_compaction.c
@@ -24,7 +24,7 @@ struct page *balloon_page_enqueue(struct
 {
 	unsigned long flags;
 	struct page *page = alloc_page(balloon_mapping_gfp_mask() |
-				__GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_ZERO);
+				       __GFP_NOMEMALLOC | __GFP_NORETRY);
 	if (!page)
 		return NULL;
 

_