From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DC81C433EF for ; Tue, 5 Oct 2021 13:32:24 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0FFCA61207 for ; Tue, 5 Oct 2021 13:32:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0FFCA61207 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=invisiblethingslab.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.202260.356963 (Exim 4.92) (envelope-from ) id 1mXkXW-0001mf-GP; Tue, 05 Oct 2021 13:31:26 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 202260.356963; Tue, 05 Oct 2021 13:31:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mXkXW-0001mY-DO; Tue, 05 Oct 2021 13:31:26 +0000 Received: by outflank-mailman (input) for mailman id 202260; Tue, 05 Oct 2021 13:31:24 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mXkXU-0001mS-FU for xen-devel@lists.xenproject.org; Tue, 05 Oct 2021 13:31:24 +0000 Received: from out4-smtp.messagingengine.com (unknown [66.111.4.28]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 63476c89-b322-45e5-9025-cb584fd792b7; Tue, 05 Oct 2021 13:31:23 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3AB285C026A; Tue, 5 Oct 2021 09:31:23 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 05 Oct 2021 09:31:23 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Oct 2021 09:31:22 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 63476c89-b322-45e5-9025-cb584fd792b7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=EivQqt +HIo/wojGUEcP7IuAFUMmltKJUbP1xgnBaQeU=; b=Ka1DWS4GDKhLKbThzTImqa nWFLSWeI1Gh/YvH08FjeDsr4LqwlVVUGKzbCRJLLA15tfNVbPnB1m6CCT4VSYFiG UXRGOgcG7EmXuyL02tXfIHa0rYFLrJuLVZl7xk29N08GG7lUUovHdWDrVZRhjOk+ BRDZSSyPDulOASEIKRYaJklVweYjNIBWU0K5KG2YcHoDZDESs5zDPmAEtdaFMoqI kl2VP1YmYmsCwyq0aujTLO+1hMwaTyu4XFdCghRHoRv6noHNITyIRAY8yhXqrZDs /bFwu53R908FN0GXEW2NVyqSRYD/XMO7k/+rZnZkITPU3po41w/qlBUz1ReCsTNQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudelgedgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeetveff iefghfekhffggeeffffhgeevieektedthfehveeiheeiiedtudegfeetffenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhes ihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm X-ME-Proxy: Date: Tue, 5 Oct 2021 15:31:18 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Juergen Gross Cc: xen-devel , Jan Beulich Subject: Re: xen-balloon thread using 100% of CPU, regression in 5.4.150 Message-ID: References: <37c22c61-80be-fc48-18e6-2b1ee22cc765@suse.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TQOmFEmeMsC7xW5m" Content-Disposition: inline In-Reply-To: --TQOmFEmeMsC7xW5m Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Tue, 5 Oct 2021 15:31:18 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Juergen Gross Cc: xen-devel , Jan Beulich Subject: Re: xen-balloon thread using 100% of CPU, regression in 5.4.150 On Tue, Oct 05, 2021 at 10:05:39AM +0200, Juergen Gross wrote: > On 04.10.21 11:14, Marek Marczykowski-G=C3=B3recki wrote: > > On Mon, Oct 04, 2021 at 07:31:40AM +0200, Juergen Gross wrote: > > > On 03.10.21 06:47, Marek Marczykowski-G=C3=B3recki wrote: > > > > Hi, > > > >=20 > > > > After updating a PVH domU to 5.4.150, I see xen-balloon thread using > > > > 100% CPU (one thread). > > > > This is a domain started with memory=3Dmaxmem=3D716800KiB (via libv= irt). Then, > > > > inside, I see: > > > >=20 > > > > # cat /sys/devices/system/xen_memory/xen_memory0/target_kb > > > > 716924 > > > > # cat /sys/devices/system/xen_memory/xen_memory0/info/current_kb > > > > 716400 > > > >=20 > > > > Doing `cat info/current_kb > target_kb` "fixes" the issue. But stil= l, > > > > something is wrong - on earlier kernel (5.4.143 to be precise), it > > > > wasn't spinning, with exactly the same values reported in sysfs. It > > > > shouldn't run in circles if it can't get that much memory it wants.= I > > > > strongly suspect "xen/balloon: use a kernel thread instead a workqu= eue" > > > > or related commit being responsible, but I haven't verified it. > > >=20 > > > I think you are right. I need to handle the BP_ECANCELED case similar= to > > > BP_EAGAIN in the kernel thread (wait until target size changes again). > > >=20 > > > One further question: do you see any kernel message in the guest rela= ted > > > to the looping balloon thread? > >=20 > > Nothing, only the usual "xen:balloon: Initialising balloon driver", and > > nothing related to balloon after that. >=20 > Could you try the attached patch, please? I've tested it briefly with > PV and PVH guests. Yes, it helps, thanks! --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab --TQOmFEmeMsC7xW5m Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmFcU6cACgkQ24/THMrX 1yxjTQf/aW3yKfiquu0qMc5bvmbmqXYSY8D57IP9xJ9/Ft2hciEkjWs5MgmgogWL yr76bR1G3WIxZ2YT2lPg6JfBVPgPCkTgDVGW5fyPKcxAh0Fpk/3K0+a3c5zf3c06 iUlZ0zWFydpOayntOfYw1ZBlaHbIdZHvDDceYBv8NSLhoN7qcx12xbWcwKlA7uGh Gs+Vj0MqlMrD52XeloXRQ51Wpr5rnxgyT9E0/NXFZWI6DOSnbDxVL2Npm60qm8BO EZxfcyvmKgKNpm98CwoPveNja8tU90GuyHEmgJDRE8m6bPUIou15xmM/qBJlJ/Da uWTW/W7xu3+fX46e4MPsqlqjf2Jx6A== =CeFV -----END PGP SIGNATURE----- --TQOmFEmeMsC7xW5m--