From: Roger Pau Monne Date: Mon, 27 Jul 2020 09:13:40 +0000 (+0200) Subject: xen/balloon: make the balloon wait interruptible X-Git-Tag: v4.9.233~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0fdcc4156ccd30bbe6d531487b551068b27c0814;p=platform%2Fkernel%2Flinux-amlogic.git 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é Reviewed-by: Juergen Gross Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200727091342.52325-3-roger.pau@citrix.com Signed-off-by: Juergen Gross Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index e8976b51c42b..1b76e8a99c40 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -634,11 +634,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; } }