xen/balloon: Don't continue ballooning when BP_ECANCELED is encountered
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Tue, 7 Oct 2014 21:00:07 +0000 (17:00 -0400)
committerDavid Vrabel <david.vrabel@citrix.com>
Thu, 23 Oct 2014 15:24:01 +0000 (16:24 +0100)
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@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
drivers/xen/balloon.c

index 1e0a317d3dcdda5b6041ae8481006f1d1479934b..3860d02729dcc4909798d778fa28f3c71c6eec8f 100644 (file)
@@ -167,6 +167,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;