[PATCH 2/2] xen/balloon: Don't continue ballooning when BP_ECANCELED is encountered

Tim Gardner tim.gardner at canonical.com
Mon Nov 7 17:29:57 UTC 2016


From: Boris Ostrovsky <boris.ostrovsky at oracle.com>

BugLink: http://bugs.launchpad.net/bugs/1304001

Commit 3dcf63677d4e ("xen/balloon: cancel ballooning if adding new
memory failed") makes reserve_additional_memory() return BP_ECANCELED
when an error is encountered. This error, however, is ignored by the
caller (balloon_process()) since it is overwritten by subsequent call
to update_schedule(). This results in continuous attempts to add more
memory, all of which are likely to fail again.

We should stop trying to schedule next iteration of ballooning when
the current one has failed.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky at oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper at oracle.com>
Signed-off-by: David Vrabel <david.vrabel at citrix.com>
(cherry picked from commit fd8b79511349efd1f0decea920f61b93acb34a75)
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
---
 drivers/xen/balloon.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index ebcef4b..9c39b85 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -180,6 +180,9 @@ static struct page *balloon_next_page(struct page *page)
 
 static enum bp_state update_schedule(enum bp_state state)
 {
+	if (state == BP_ECANCELED)
+		return BP_ECANCELED;
+
 	if (state == BP_DONE) {
 		balloon_stats.schedule_delay = 1;
 		balloon_stats.retry_count = 1;
-- 
2.7.4





More information about the kernel-team mailing list