Commit 2a2c8a90 authored by Roger Pau Monne's avatar Roger Pau Monne Committed by Kelsey Skunberg

xen/balloon: make the balloon wait interruptible

BugLink: https://bugs.launchpad.net/bugs/1892822

commit 88a479ff upstream.

So it can be killed, or else processes can get hung indefinitely
waiting for balloon pages.
Signed-off-by: default avatarRoger Pau Monné <roger.pau@citrix.com>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200727091342.52325-3-roger.pau@citrix.comSigned-off-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent e8b3d1a8
......@@ -623,11 +623,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;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment