[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (auto-)ballooning issue


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 28 Jan 2026 12:14:31 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eUQ6H63oXfjU5OU+v6AEd+oY85vTZo7mT+SDAiGQkuE=; b=PRTAKmP9gsbmbhXOgtkp8VfHZalMuvP0icqmXJPTcw6ulaem4dzwtrmtPQCVSgvMfJGGB7BcLtSuUkTemWKsn18Ofz9jGKDMv4pIGaLq18WZIb+mSeafvwwxBGUICNeCIV/quBZNVpMKwCQeb0g72DZxHd8+p+OzyOclfBzId/DpxJ6dNUNCH2S8V+f2yr111PZuS/hlvYUj9kJeaYgDLVyBO/f9pbCTLiUqDZujracmV7ROjONvEx9+z1aYVq2PMggJkVtdPU+g3m3iZWxsVhtmH765/93WvxxHcWBJ9UkiYfB36+sKqdCATEVg7Ep1eFyDT35FLcp/HnwD9qIPkw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Bx24+zPFj3InlBkd2mcCHAULJmGEcrJwygNKM6XwvHA3UiBJCPr1W13aGZx1L7qpEadOexYu5t9wd4lPKYE+vYr+fUg0mAFpuMz8u37RbVO6We1JCWTWMB7eZTdLWKKnxOEreTjvgRrJoR7WkwHknxFxtjRkjm34DKbwO+rwxghOhuzLTSY3498A5CaIMKrw0Ox644Pu9udwGo4C0mjlsQRE20Xb5JCy2f/rNy3E1GFuLk1KufP5tWwN0iuYv01QGjIiJVxs6AN+cXLC3Fvuozu6Uxbf8ebzsYroJlMPtj92UIDefopqilo8+wY1tD8pqsl+FITl2lxJaQDCc/S2rg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Wed, 28 Jan 2026 11:14:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Aug 26, 2025 at 05:28:29PM +0200, Jan Beulich wrote:
> Hello,
> 
> the other day I observed a strange issue with XTF's selftest failing to
> have its VMs created, when running all flavors in a group. (Other tests
> look to be similarly affected, it's just the selftest that I run most
> frequently.) Originally I suspected a PVH-specific issue, but the
> problem surfacing only there is because with PVH Dom0 I have less free
> memory left after boot than with PV Dom0. Beyond that, both
> configurations use the same hypervisor, with built-in DOM0_MEM="-255M".
> 
> The issue looks to be further affected (but not caused) by domain
> cleanup being quite a bit slower under PVH Dom0, compared to PV. I.e.
> by the time the 2nd test is started, memory from the 1st one still
> wasn't completely freed. The result is that randomly one of the latter
> (batched) tests fails at domain creation ("failed to free memory for
> the domain").
> 
> xl's freemem() calls libxl_set_memory_target() followed by
> libxl_wait_for_memory_target(). The latter function expects the domain
> to balloon down enough for its ->tot_pages (in the hypervisor) to be
> at or below the previously set target. However, already immediately
> after boot "xl list -l" and "xs ls /" show target values which are 1
> page below the hypervisor's record. With libxl_set_memory_target()
> requesting relative adjustment, the Dom0 kernel will balloon out the
> requested number of pages, but ->tot_pages going down by as many pages
> isn't enough to please libxl_wait_for_memory_target().
> 
> I'm not even close to having an opinion as to where the problem is: It
> could be that the kernel's balloon driver is off by a page. I'm more
> inclined though to think that it is entirely unrealistic to expect the
> kernel's balloon driver and Xen to have an exactly matching view of
> the memory owned by the domain. Yet then it is simply invalid to
> compare values taken from Xenstore against values taken from Xen. While
> problematic for absolute requests, for relative ones it should be
> possible apply the decrement to the source later used to compare
> against while waiting.

Little late, sorry.  I think:

xen/balloon: improve accuracy of initial balloon target for dom0
https://lore.kernel.org/xen-devel/20260128110510.46425-3-roger.pau@xxxxxxxxxx/

Might improve the situation here, as it should make the dom0 initial
balloon target match what the toolstack expects, and then
(auto-)ballooning targets should also be accurate w.r.t. the memory
freed by dom0.

Regards, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.