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

Re: [PATCH] Partial revert "x86/xen: fix balloon target initialization for PVH dom0"


  • To: Jason Andryuk <jason.andryuk@xxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 22 Jan 2026 18:46:15 +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=umdk8Dz3+SgrY+A6+i/QveUMdiCuv1WF7xlrptnDDXw=; b=xL9m9qCbtwynyhcT/5U6WOieqkD9WNqqXkBF5CoDeAdJ7Tww1ZlvZDLlv74fM7Ux+ma2n39iId0Ieahq0NAjZT0YpFR/3jVAXQhsQvXXQvG7BemkO5f1wul5IgYFBHZcn4DJQbQ7nJvziPNFNE1s5eSxy6kIQCOh5Q0myRYuBfiCRsAVyjHkab7Lf9SiZ5C3STrKczSKHDszQUrXq/DBmiZWgrjU0aJNjnkJxvtK5aJKKUoSEEU7vCzJ1Di+E4ya0M9KE4G/EXkrzOQVy0QJD7eGI1uPBIHao7cUbKlXqODqMjfHrkbBe4L6RIz/bQEi8xnPxwq4DOXebiGaJiJqWQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LLafgYG5oXeC7PU4+BD0Y/aZ+D0iH/v8qPrxrbkstrT7XQjKZDnya+edwMRcvlgXE2WPElYweJxxNfOft7tLhfer/oWfL2dWB6pT/sOktbuVelni6So8kjcLT6SnAoijvkprNZYjTbeIpPtAkgjrZrHA+bFmWbo2rszTz2yErdVzeVlLjcVa+gC21eTUCaAnVQYtBNGx68QbmN5AaPryWiNUf4odryPXsnk9GO5rxbaH/lVPoN5jofgkSVXT74pRYPp3D5ZVwUK2Fr7eoGTa/X3pv/UB5Ks0rl+ZsX8iimsDidzxxrj8Getu0Ld/B4vYACNWs7FsuQjX6XgDqE5dCw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, James Dingwall <james@xxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
  • Delivery-date: Thu, 22 Jan 2026 17:46:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Jan 22, 2026 at 12:03:47PM -0500, Jason Andryuk wrote:
> On 2026-01-22 11:57, Roger Pau Monné wrote:
> > On Thu, Jan 22, 2026 at 09:40:01AM -0500, Jason Andryuk wrote:
> > > On 2026-01-21 12:49, Roger Pau Monné wrote:
> > > > I haven't tested it yet to see whether that's OK to do on PV, I would
> > > > think PV and PVH would be the same here, since the setting of the
> > > > xenstore target value is based in the return of
> > > > XENMEM_current_reservation for both.
> > > 
> > > On a system with 32GB and dom0=pvh dom0_mem=7G:
> > > 
> > > [    0.295201] xen:balloon: current_pages: 1835007 get_num_physpages 
> > > 8220126
> > > xen_released_pages 6385120
> > > [    0.295201] ------------[ cut here ]------------
> > > [    0.295201] Released pages underflow current target
> > > 
> > > 8220126 - 6385120 = 1835006
> > > 
> > > And also for PV:
> > > 
> > > [    1.406923] xen:balloon: current_pages: 1835008 get_num_physpages 
> > > 8220127
> > > xen_released_pages 6385120
> > > [    1.406928] ------------[ cut here ]------------
> > > [    1.406931] Released pages underflow current target
> > > 
> > > 
> > > So we don't want to subtract xen_released_pages for dom0.  Is
> > > xen_released_pages expected to be non-zero for a domU?
> > 
> > Oh, yes.  In fact I think the patch here is wrong for PV dom0, as it
> > shouldn't subtract xen_released_pages from xen_start_info->nr_pages.
> > I will need to send v2.
> 
> To be clear, the numbers and warning are from the follow on
> current_reservation patch.

Yes, but I think it's also bad to use xen_start_info->nr_pages -
xen_released_pages (my current proposal).  xen_released_pages had a
different meaning on PV which I kind of stolen for the unpopulated
alloc work.  It was originally meant to signal pages that are freed
during the boot process when it's not possible to relocate them; see
xen_set_identity_and_release_chunk.  Unpopulated alloc doesn't free
the pages it uses, because they are already free to start with.

I think I need to introduce a new counter that accounts for pages
consumed by unpopulated alloc strictly, and not re-use the
xen_released_pages counter.

All this memory accounting is far more complex than it should be
sadly.

Thanks, Roger.



 


Rackspace

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