Skip to content

Commit

Permalink
xen/balloon: make the balloon wait interruptible
Browse files Browse the repository at this point in the history
commit 88a479f upstream.

So it can be killed, or else processes can get hung indefinitely
waiting for balloon pages.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200727091342.52325-3-roger.pau@citrix.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
royger authored and gregkh committed Aug 19, 2020
1 parent ee4c180 commit 8e41ac0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/xen/balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,13 @@ static int add_ballooned_pages(int nr_pages)
if (xen_hotplug_unpopulated) {
st = reserve_additional_memory();
if (st != BP_ECANCELED) {
int rc;

mutex_unlock(&balloon_mutex);
wait_event(balloon_wq,
rc = wait_event_interruptible(balloon_wq,
!list_empty(&ballooned_pages));
mutex_lock(&balloon_mutex);
return 0;
return rc ? -ENOMEM : 0;
}
}

Expand Down

0 comments on commit 8e41ac0

Please sign in to comment.