Skip to content

Commit

Permalink
xen/balloon: Don't continue ballooning when BP_ECANCELED is encountered
Browse files Browse the repository at this point in the history
Commit 3dcf636 ("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>
  • Loading branch information
Boris Ostrovsky authored and David Vrabel committed Oct 23, 2014
1 parent f114040 commit fd8b795
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/xen/balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fd8b795

Please sign in to comment.