aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger Pau Monne <roger.pau@citrix.com>2020-07-27 11:13:40 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-08-19 08:16:29 +0200
commit8e41ac0bfdfdd7b3dab56562077487bb397c1f02 (patch)
tree4747a9571c6bba6fdfb6c443cafb93cb917c0df5
parentee4c180d93d0c33565c3edd32dbce7760084493b (diff)
downloadlinux-yocto-8e41ac0bfdfdd7b3dab56562077487bb397c1f02.tar.gz
linux-yocto-8e41ac0bfdfdd7b3dab56562077487bb397c1f02.tar.bz2
linux-yocto-8e41ac0bfdfdd7b3dab56562077487bb397c1f02.zip
xen/balloon: make the balloon wait interruptible
commit 88a479ff6ef8af7f07e11593d58befc644244ff7 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>
-rw-r--r--drivers/xen/balloon.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index d792fa972d96..ebb05517b6aa 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -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;
}
}