提交 23f26e1b 编写于 作者: J Juergen Gross 提交者: Yang Yingliang

xen/balloon: fix ballooned page accounting without hotplug enabled

[ Upstream commit c673ec61ade89bf2f417960f986bc25671762efb ]

When CONFIG_XEN_BALLOON_MEMORY_HOTPLUG is not defined
reserve_additional_memory() will set balloon_stats.target_pages to a
wrong value in case there are still some ballooned pages allocated via
alloc_xenballooned_pages().

This will result in balloon_process() no longer be triggered when
ballooned pages are freed in batches.
Reported-by: NNicholas Tsirakis <niko.tsirakis@gmail.com>
Signed-off-by: NJuergen Gross <jgross@suse.com>
Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: NJuergen Gross <jgross@suse.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 948fdace
...@@ -395,7 +395,8 @@ static struct notifier_block xen_memory_nb = { ...@@ -395,7 +395,8 @@ static struct notifier_block xen_memory_nb = {
#else #else
static enum bp_state reserve_additional_memory(void) static enum bp_state reserve_additional_memory(void)
{ {
balloon_stats.target_pages = balloon_stats.current_pages; balloon_stats.target_pages = balloon_stats.current_pages +
balloon_stats.target_unpopulated;
return BP_ECANCELED; return BP_ECANCELED;
} }
#endif /* CONFIG_XEN_BALLOON_MEMORY_HOTPLUG */ #endif /* CONFIG_XEN_BALLOON_MEMORY_HOTPLUG */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册