Commit af54aed9 authored by Wei Wang's avatar Wei Wang Committed by Linus Torvalds
Browse files

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

Revert commit bb01b64c ("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

[ new changelog text]
Fixes: bb01b64c

 ("mm/balloon_compaction.c: enqueue zero page to balloon device")
Signed-off-by: default avatarWei Wang <>
Acked-by: default avatarMichael S. Tsirkin <>
Acked-by: default avatarMichal Hocko <>
Cc: zhenwei.pi <>
Cc: David Hildenbrand <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent c0a6a5ae
......@@ -24,7 +24,7 @@ struct page *balloon_page_enqueue(struct balloon_dev_info *b_dev_info)
unsigned long flags;
struct page *page = alloc_page(balloon_mapping_gfp_mask() |
if (!page)
return NULL;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment