From patchwork Thu Aug 20 09:22:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 265548 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C5EDC433E3 for ; Thu, 20 Aug 2020 11:40:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 43BAC204EA for ; Thu, 20 Aug 2020 11:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597923636; bh=izsPDXE/kv5fB/lp9O5mAjm5NcafBr6DiXNzeOK7yYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TuYVMXrkXzo1PPAuFyX1KWD2XhItwxQ152aR1TEFhRMFIMISLROiahkvX/S3To+H8 uQ/kLW1ICYGJ7lS76SgodX2LVqn4IfK+KU7IGuFHQF1VeGG1h1zeFQ3tbD92lrTn+K lKtjkf+0l022Kla8Z8R6QwYRS3H6N3/NF9zQCsvM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730475AbgHTLke (ORCPT ); Thu, 20 Aug 2020 07:40:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:60266 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730554AbgHTKFF (ORCPT ); Thu, 20 Aug 2020 06:05:05 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7EE2A22BEA; Thu, 20 Aug 2020 10:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597917905; bh=izsPDXE/kv5fB/lp9O5mAjm5NcafBr6DiXNzeOK7yYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eOBf3Eh5aSoF55eyYdCqxrHhERWV9aBwBYjaCrwLQMxq68y9P4Rl/qB6DaJ4lYJr7 LBphgrxt98ch4MAUgPkcuuDhKkPZ4SUz6dPNdicY3izq8cl11W4vNb2DrBiNArdqFv cpzw4p/AtiZGlyUyzd5rgDW+fNI6JvjbBqCsLwM8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Juergen Gross Subject: [PATCH 4.9 168/212] xen/balloon: make the balloon wait interruptible Date: Thu, 20 Aug 2020 11:22:21 +0200 Message-Id: <20200820091610.879485392@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091602.251285210@linuxfoundation.org> References: <20200820091602.251285210@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Roger Pau Monne 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 --- drivers/xen/balloon.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -634,11 +634,13 @@ static int add_ballooned_pages(int nr_pa 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; } }