From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Thorsten Leemhuis <regressions@leemhuis.info>
Cc: Juergen Gross <jgross@suse.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Linux kernel regressions list <regressions@lists.linux.dev>,
yannick.martin+kernelorg@okazoo.eu
Subject: Re: [regression] Bug 221745 - PV DomU ballooning driver init issue
Date: Mon, 27 Jul 2026 18:51:15 +0200 [thread overview]
Message-ID: <ameMgwuUIhZbslHh@macbook.local> (raw)
In-Reply-To: <f7fe5959-f0c6-430c-8404-927d7944c836@leemhuis.info>
On Mon, Jul 27, 2026 at 10:42:25AM +0200, Thorsten Leemhuis wrote:
> Hi Roger! FYI, it seems your change 0949c646d64697 ("Partial revert
> "x86/xen: fix balloon target initialization for PVH dom0"") [v7.0-rc1]
> caued a regression. For details see
> https://bugzilla.kernel.org/show_bug.cgi?id=221745
>
> To quote the initial comment:
>
> > Since commit db8c4b1 (Partial revert "x86/xen: fix balloon target initialization for PVH dom0"), xen ballooning fails to init correctly on domU (on amd64 arch) with the following configuration:
> >
> > -- xl.cfg
> > ...
> > memory = '2048'
> > maxmem = '4096'
> > ...
> > --
> >
> > -- domU balloon dmesg (init fails)
> > [ 0.908337] xen:balloon: Initialising balloon driver
> > [ 0.940721] Extra pages underflow current target
Yeah, I'm afraid the original fix commit didn't fully fix the issues,
so there's the following change (chunk below) that's needed
additionally to cope with memory != maxmem on PV guests.
I've done some basic testing and it seems to solve the issue, could
you give it a spin also? (just to make sure I'm not missing anything
else).
Thanks, Roger.
---
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index e7f1d4ca6d75..c20a1ff8292d 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -703,19 +703,26 @@ static int __init balloon_add_regions(void)
balloon_append(pfn_to_page(pfn));
/*
- * Extra regions are accounted for in the physmap, but need
- * decreasing from current_pages and target_pages to balloon
- * down the initial allocation, because they are already
- * accounted for in total_pages.
+ * For HVM domains: extra regions are accounted for in the
+ * physmap, but need decreasing from current_pages and
+ * target_pages to balloon down the initial allocation, because
+ * they are already accounted for in total_pages.
+ *
+ * For PV domains: extra regions are not accounted for in the
+ * initial memory target, and hence need adding to the stats as
+ * additional unpopulated regions.
*/
pages = extra_pfn_end - start_pfn;
- if (pages >= balloon_stats.current_pages ||
- pages >= balloon_stats.target_pages) {
+ if (xen_pv_domain()) {
+ balloon_stats.total_pages += pages;
+ } else if (pages >= balloon_stats.current_pages ||
+ pages >= balloon_stats.target_pages) {
WARN(1, "Extra pages underflow current target");
return -ERANGE;
+ } else {
+ balloon_stats.current_pages -= pages;
+ balloon_stats.target_pages -= pages;
}
- balloon_stats.current_pages -= pages;
- balloon_stats.target_pages -= pages;
}
return 0;
next prev parent reply other threads:[~2026-07-27 16:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 8:42 [regression] Bug 221745 - PV DomU ballooning driver init issue Thorsten Leemhuis
2026-07-27 16:51 ` Roger Pau Monné [this message]
2026-07-27 17:10 ` Yannick Martin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ameMgwuUIhZbslHh@macbook.local \
--to=roger.pau@citrix.com \
--cc=jgross@suse.com \
--cc=regressions@leemhuis.info \
--cc=regressions@lists.linux.dev \
--cc=xen-devel@lists.xenproject.org \
--cc=yannick.martin+kernelorg@okazoo.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.