Skip to content

Commit c673ec6

Browse files
committed
xen/balloon: fix ballooned page accounting without hotplug enabled
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: Nicholas Tsirakis <[email protected]> Signed-off-by: Juergen Gross <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent fa2ac65 commit c673ec6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/xen/balloon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ static struct notifier_block xen_memory_nb = {
395395
#else
396396
static enum bp_state reserve_additional_memory(void)
397397
{
398-
balloon_stats.target_pages = balloon_stats.current_pages;
398+
balloon_stats.target_pages = balloon_stats.current_pages +
399+
balloon_stats.target_unpopulated;
399400
return BP_ECANCELED;
400401
}
401402
#endif /* CONFIG_XEN_BALLOON_MEMORY_HOTPLUG */

0 commit comments

Comments
 (0)