From nobody Mon Feb 9 23:00:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1595594610; cv=none; d=zohomail.com; s=zohoarc; b=DU6FB3PrYhetvGgzbVr7NM8U+fyjurfC6Pm8MAbQAjbYcOMnG+SaqzihLntgKS0LSosUQ+K5fdPiDOK/rnbTmc+HnESsLW5IpyDWIFRz4Yu58E5TbSCEIKutQC6W19atozK4wqSuWNFcHw+hbnyXYDn84L1cE4FyO7u6Iglj7NI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595594610; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IeG7X37Tzb95FNjIKw2epgIJ5XiUXyBhBho8iBa5OI0=; b=T6L+zDmD12GA9yJNPIUR2HZPzuFBSgm9vhJ/CBmvAdDHoiNDw5U8fVDutE8ZZ1lg0Emi/h715OIWaaIxJAv1n3Cr+gja2XCuxRCNUw1TcAQ8r303tQHtSCFACci8IguSEl2i/HxqQJA2+63B341zcpL5erfh8Uz7qiy1ICowbBg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1595594610606745.7431980560025; Fri, 24 Jul 2020 05:43:30 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jyx2V-00015o-IS; Fri, 24 Jul 2020 12:43:03 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jyx2U-00012u-40 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2020 12:43:02 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 31f451f1-cdab-11ea-880c-bc764e2007e4; Fri, 24 Jul 2020 12:42:55 +0000 (UTC) X-Inumbo-ID: 31f451f1-cdab-11ea-880c-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1595594576; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7Tw4G/V7kxbTklR4OkIgBDvRcTQey+xrJa3KZIIL0yE=; b=Wr12Kj69LSoxJfKjPvI9zKeyP+8qjKurWGX/V1S90YdMWo2SxUBm5mR4 FWTFEvXA4N9ijDkQtc8GPDZEGXrnhA8Jkre1m7+vZNVToTQg2lXoi0I1a Yjknuae2jRN+PSMFW35gT8v8c16ILAY+xALtDbWG4kTcvAoTtdu2rRLGk Q=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: 1RmtWXLEVLsjBBebMyNb9dJntTLAmrgMDJmAs3T9l48/E9hvv/9Zz/JGcwmC/qk907TZ5cCnhv JD3rZBNMfCwCn/WlbKh5LBFv7oL/dKr6eU4+jdqj7dHQOQQqNjdvpYQ66LyEy3gb9PIHCC1MrD kmD0iJEk7E1uJWWtM02WnuIA+Yoq9Ra2+LyjJAAjbuuR1etEvwEpbBKBYFOxclIwriVbLZlQRM khIh9nzeMT3Dhtv9/vt6aqAXVFbKhToIhnx5qJOUTVfm1CHLGLlsws80oqkAFKPc/SW8TD/l4h FnA= X-SBRS: 2.7 X-MesageID: 23139909 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.75,390,1589256000"; d="scan'208";a="23139909" From: Roger Pau Monne To: Subject: [PATCH v2 2/4] xen/balloon: make the balloon wait interruptible Date: Fri, 24 Jul 2020 14:42:39 +0200 Message-ID: <20200724124241.48208-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200724124241.48208-1-roger.pau@citrix.com> References: <20200724124241.48208-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , stable@vger.kernel.org, xen-devel@lists.xenproject.org, Boris Ostrovsky , Roger Pau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) So it can be killed, or else processes can get hung indefinitely waiting for balloon pages. Signed-off-by: Roger Pau Monn=C3=A9 Cc: stable@vger.kernel.org Reviewed-by: Juergen Gross --- Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini 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 =3D reserve_additional_memory(); if (st !=3D BP_ECANCELED) { + int rc; + mutex_unlock(&balloon_mutex); - wait_event(balloon_wq, + rc =3D wait_event_interruptible(balloon_wq, !list_empty(&ballooned_pages)); mutex_lock(&balloon_mutex); - return 0; + return rc ? -ENOMEM : 0; } } =20 --=20 2.27.0