linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: <linux-kernel@vger.kernel.org>
Cc: Roger Pau Monne <roger.pau@citrix.com>, <stable@vger.kernel.org>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	<xen-devel@lists.xenproject.org>
Subject: [PATCH 2/3] xen/balloon: make the balloon wait interruptible
Date: Thu, 23 Jul 2020 10:45:22 +0200	[thread overview]
Message-ID: <20200723084523.42109-3-roger.pau@citrix.com> (raw)
In-Reply-To: <20200723084523.42109-1-roger.pau@citrix.com>

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>
Cc: stable@vger.kernel.org
---
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org
---
 drivers/xen/balloon.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 3cb10ed32557..292413b27575 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -568,11 +568,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;
 		}
 	}
 
-- 
2.27.0


  parent reply	other threads:[~2020-07-23  8:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23  8:45 [PATCH 0/3] xen/balloon: fixes for memory hotplug Roger Pau Monne
2020-07-23  8:45 ` [PATCH 1/3] xen/balloon: fix accounting in alloc_xenballooned_pages error path Roger Pau Monne
2020-07-23  8:45 ` Roger Pau Monne [this message]
2020-07-23  8:45 ` [PATCH 3/3] memory: introduce an option to force onlining of hotplug memory Roger Pau Monne
2020-07-23 11:37   ` David Hildenbrand
2020-07-23 11:52     ` David Hildenbrand
2020-07-23 12:23     ` Roger Pau Monné
2020-07-23 12:28       ` Jürgen Groß
2020-07-23 12:31         ` David Hildenbrand
2020-07-23 13:08         ` Roger Pau Monné
2020-07-23 13:14           ` David Hildenbrand
2020-07-23 13:25             ` Roger Pau Monné
2020-07-23 13:20           ` Jürgen Groß
2020-07-23 13:39             ` Roger Pau Monné
2020-07-23 13:49               ` Jürgen Groß
2020-07-23 13:22       ` David Hildenbrand
2020-07-23 13:47         ` David Hildenbrand
2020-07-23 13:53           ` Jürgen Groß
2020-07-23 13:59         ` Roger Pau Monné
2020-07-23 15:10           ` Jürgen Groß
2020-07-23 16:03             ` Andrew Cooper
2020-07-23 16:22             ` Roger Pau Monné
2020-07-23 17:39               ` David Hildenbrand
2020-07-24  7:28                 ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200723084523.42109-3-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sstabellini@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).