Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2513663pxb; Fri, 29 Oct 2021 03:01:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeVnrsB1HiX7fytUPQvcZsicG8GgPgKrkNv7yHXPKXOfl2l2Xi7BaEnG8mSkjwWsPSV/Db X-Received: by 2002:a17:907:7656:: with SMTP id kj22mr12358228ejc.191.1635501679327; Fri, 29 Oct 2021 03:01:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635501679; cv=none; d=google.com; s=arc-20160816; b=gJ1Do+vZPA3EF9YpTLeUSlXKbl9fNGan1Rnhrk+YpDop7SpmJ9SiPZMPHs13T/0Vbo UbL2QCIQJpuAi4LG4H/xhieM/Vkwu/SwiSuzcWxFKrXNAIzZJZwmk1G7rggaNvowNTZf H9HDRlcINSfK5P0rlODUDq5gumYP8XVir8TJ3pCEOzEvOUYm7kbLnAUakroVPzbO4czp 3zoHmH2KpLEs1eNotyIBJ5VV1x+GhMNm2SZ0FOQAa8OsiUscMo9WjN2MoCsJ+v+iYuaW Y8XX+qCzw9IZ1tLPGkSGlxaUGfVIdKpw1zzZS+OW2KKTOJezeexS0jLvDPqL6/YXE+Zv y6iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3/Egfh4X+ZdPXzTj4EaqMgbhEWAl0zPu3cQnawCwVO4=; b=qlmatf/cto+bCBW2wTzGChSkIuLwXQqE7guNMp4qX98vCytPYuY33mGV6lMlTQKWIE 4YsFt7bhIbnkdTIkOPMLBxdnGfwHHUPSVaRt7rgas/V0GLRVPjuECaDr3OQexVeWi+ZK ty2/FDVzbmvCGASFgX3uuoFxKTMsvhwLQt4X8L9QtQXDUd0lAd1WIFRZHNHUD0Mzpn82 6Vcb94BHeAVSd9atMAruf7rWOdsmY71Jtx2Mu+Li6bpRUtQbaNDUomFU36oJsSM01ZMh Bn4GgxrrxXMklO7651h2wv0hcvEu5Isok/14vxBOvTMBdiWS/FnnOWVLXdy5dbmZXJ9I XqsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=kCKWYV9u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si11013757edb.396.2021.10.29.03.00.50; Fri, 29 Oct 2021 03:01:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=kCKWYV9u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231622AbhJ2J7v (ORCPT + 99 others); Fri, 29 Oct 2021 05:59:51 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:55779 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231579AbhJ2J7v (ORCPT ); Fri, 29 Oct 2021 05:59:51 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3B5E95C0220; Fri, 29 Oct 2021 05:57:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 29 Oct 2021 05:57:22 -0400 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=3/Egfh 4X+ZdPXzTj4EaqMgbhEWAl0zPu3cQnawCwVO4=; b=kCKWYV9uq+QIfP4Qg3wcFm fELenkkPgPvNOALaIoR2v1v9PE2h0vWPGYl/PKkJu8sdlHc9LXSFTc3ZR2gV/KIk BruKbAMKQ5qO+TXVGFLdA+PnyXT87Xk3/GGeHjbwzJ09Aqc1yThs4ZuQaEwDeBai Iod1ItadzdcoI+cpV5gxJCVOJjIM9mog4bzakYfkY8UjQ3FZ67hBKL7hqJhS5meS qqmUx1SyowR5LF1LOXwwxPFsr+lP2/KCO8q0A16PIRtWHjhtT1yjE1eBPyaRtT8P u12vnRprhMeV8RiMpylj5uF7FrVMFApaYUDtNcGbPmK+N2O+0Gm30J2N73YNaExg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdeghedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeehvedv ueevheekhefhvefggffgvedugeetuefgleeivdehgfeuieeugfetteeiffenucffohhmrg hinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslh grsgdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 29 Oct 2021 05:57:20 -0400 (EDT) Date: Fri, 29 Oct 2021 11:57:17 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Juergen Gross Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, Boris Ostrovsky , Stefano Stabellini , stable@vger.kernel.org Subject: Re: [PATCH] xen/balloon: add late_initcall_sync() for initial ballooning done Message-ID: References: <20211028105952.10011-1-jgross@suse.com> <27e7619a-a797-5c46-9f9f-015ab488e31c@suse.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qlvPDcy0Ybnk1Q+S" Content-Disposition: inline In-Reply-To: <27e7619a-a797-5c46-9f9f-015ab488e31c@suse.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qlvPDcy0Ybnk1Q+S Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Fri, 29 Oct 2021 11:57:17 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Juergen Gross Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, Boris Ostrovsky , Stefano Stabellini , stable@vger.kernel.org Subject: Re: [PATCH] xen/balloon: add late_initcall_sync() for initial ballooning done On Fri, Oct 29, 2021 at 06:48:44AM +0200, Juergen Gross wrote: > On 28.10.21 22:16, Marek Marczykowski-G=C3=B3recki wrote: > > On Thu, Oct 28, 2021 at 12:59:52PM +0200, Juergen Gross wrote: > > > When running as PVH or HVM guest with actual memory < max memory the > > > hypervisor is using "populate on demand" in order to allow the guest > > > to balloon down from its maximum memory size. For this to work > > > correctly the guest must not touch more memory pages than its target > > > memory size as otherwise the PoD cache will be exhausted and the guest > > > is crashed as a result of that. > > >=20 > > > In extreme cases ballooning down might not be finished today before > > > the init process is started, which can consume lots of memory. > > >=20 > > > In order to avoid random boot crashes in such cases, add a late init > > > call to wait for ballooning down having finished for PVH/HVM guests. > > >=20 > > > Cc: > > > Reported-by: Marek Marczykowski-G=C3=B3recki > > > Signed-off-by: Juergen Gross > >=20 > > It may happen that initial balloon down fails (state=3D=3DBP_ECANCELED)= =2E In > > that case, it waits indefinitely. I think it should rather report a > > failure (and panic? it's similar to OOM before PID 1 starts, so rather > > hard to recover), instead of hanging. >=20 > Okay, I can add something like that. I'm thinking of issuing a failure > message in case of credit not having changed for 1 minute and panic() > after two more minutes. Is this fine? Isn't it better to get a state from balloon_thread()? If the balloon fails it won't really try anymore (until 3600s timeout), so waiting in that state doesn't help. And reporting the failure earlier may be more user friendly. Or maybe there is something that could wakeup the thread earlier, that I don't see? Hot plugging more RAM is rather unlikely at this stage... See my patch at [1], although rather hacky (and likely - racy). [1] https://lore.kernel.org/xen-devel/YXFxKC4shCATB913@mail-itl/ --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab --qlvPDcy0Ybnk1Q+S Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmF7xX0ACgkQ24/THMrX 1yxoEgf+LmB4JafdHInJTr2vAFi4q6NgWgkLEQ5VU9RFsyxR6E1Y2gFfyQClL8T5 pbWpH16scP/dnR74YMV9WfZKL5Zvza9vFTM2okm/rKjazkuPacho2xrxIJ9EPQNz xL2XQFqi2Ma6j8RN0CePJtunyCIThttE2FFKl6BGAKCPCJKqAmMPxXnSjajQNc+6 ZKdubeSuvvlm4PKl89eyVyUrNC5QobxUlXCc7IaVRV1PEHFYrxH4pEOtsEAVfjA5 VIFzSmygyP65qWhRvLvCWHFZ8F740EypyzdNoBuhdpEfc3/O/siyFVsd1dlIdmcV Dy823HP72V5ImM2iXpgSYCOgUjiVrQ== =tifY -----END PGP SIGNATURE----- --qlvPDcy0Ybnk1Q+S--