Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp874836ybl; Thu, 12 Dec 2019 06:19:03 -0800 (PST) X-Google-Smtp-Source: APXvYqysKh+s2CLl+w6R7RaoVIFza1Esr2gedoLSjSNnM9RMjTePu/COeg2wmflRWRdw34mb826g X-Received: by 2002:a05:6830:12d0:: with SMTP id a16mr8597489otq.8.1576160343355; Thu, 12 Dec 2019 06:19:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576160343; cv=none; d=google.com; s=arc-20160816; b=TwMklTihOur/aeTQitCZ5p2xnUeh+1A6jAazQ7qenGiTmTwkVACwizRYGHj+fOyS8M al8e623TdBSYRptdxGkmTCdaRHttHhAH599cziix9PyLRYDf4ITHvg7inBJSr2tH7mYy 8ohNZGaJzWNgMQp+gn9IkRHSAnhZaAEZLjpvzO1RFcis74cZ4heKygajWSJXommkEg0b x8W2nTZ4JGdTZUQEjlsguJONRicv3Eg+ycMe4SXi5Qf6MSP8wu0ap0m5COHEPWyceIoW hPe/UDovKSJ9iKu77rjeUZ4fsE3Vj9ylzoJq3zLivDzY9N4qEcNb0BVIHlHG/r3xVQoV Uo7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=2Dew8fJlGLT8tlin4f+tPPGR0HT4cxzuLSVbwllcY/U=; b=wXdLB/PYmf9XDz7L3sXgNM+i4H+01iKQsTieiLjaUFy8Tp2vhP+c63nlXmigklN88z WXx9NTGf+oLOvv/lyEUVuojlTNWUpiZtfzvqER7kEgN/6mTEhVwv2K/xvLof4rainEs4 GtTOLDGauGxePAlUuDOYsHWUeyF1v8CgLCQWyIJJyvbL2wRhmddbsfrWQN+xKWztbCj9 OXtdPp//LHGhx6SNsPjjOK5NnEE35IoCrCzS98PoXwByBV83+2c/LkdB9Kx+7t/5jiyk ieKQHSxNGyiTFOuWfUcoSMl7BcnYDxAbT5nxMUZT/E8btsVupCJYBj2t4hfCoFC8PREm Mleg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si2858852otn.301.2019.12.12.06.18.42; Thu, 12 Dec 2019 06:19:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729652AbfLLORy (ORCPT + 99 others); Thu, 12 Dec 2019 09:17:54 -0500 Received: from mx2.suse.de ([195.135.220.15]:54270 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729560AbfLLORy (ORCPT ); Thu, 12 Dec 2019 09:17:54 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E81E7B170; Thu, 12 Dec 2019 14:17:52 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini Subject: [PATCH] xen/balloon: fix ballooned page accounting without hotplug enabled Date: Thu, 12 Dec 2019 15:17:50 +0100 Message-Id: <20191212141750.1896-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_XEN_BALLOON_MEMORY_HOTPLUG is not defined reserve_additional_memory() will set balloon_stats.target_pages to a wrong value in case there are still some ballooned pages allocated via alloc_xenballooned_pages(). This will result in balloon_process() no longer be triggered when ballooned pages are freed in batches. Reported-by: Nicholas Tsirakis Signed-off-by: Juergen Gross --- drivers/xen/balloon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 4f2e78a5e4db..0c142bcab79d 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -394,7 +394,8 @@ static struct notifier_block xen_memory_nb = { #else static enum bp_state reserve_additional_memory(void) { - balloon_stats.target_pages = balloon_stats.current_pages; + balloon_stats.target_pages = balloon_stats.current_pages + + balloon_stats.target_unpopulated; return BP_ECANCELED; } #endif /* CONFIG_XEN_BALLOON_MEMORY_HOTPLUG */ -- 2.16.4