* [regression] Bug 221745 - PV DomU ballooning driver init issue
@ 2026-07-27 8:42 Thorsten Leemhuis
2026-07-27 16:51 ` Roger Pau Monné
0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Leemhuis @ 2026-07-27 8:42 UTC (permalink / raw)
To: Roger Pau Monne
Cc: Juergen Gross, xen-devel@lists.xenproject.org,
Linux kernel regressions list, yannick.martin+kernelorg
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
> --
db8c4b1 is the backport of the commit to 6.12.y; the reporter (CCed) in
a later comment to the bug tracker confirmed that the problem happens
with 7.2.0-rc3, too, and also stated:
> The dmesg by itself is not relevant except:
> [ 1.105207] xen:balloon: Initialising balloon driver
> [ 1.222758] ------------[ cut here ]------------
> [ 1.222790] Extra pages underflow current target
> [ 1.222792] WARNING: at 0xffffffff8252a424, CPU#1: swapper/0/1
>
> init exits on ERANGE handling:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/xen/balloon.c?h=v7.2-rc4#n772
>
> because of ERANGE:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/xen/balloon.c?h=v7.2-rc4#n714
>
> kernel thread xen-balloon does not exist on VM with kernel newer than 6.12.75 (on 6.12 branch) where the patch was merged.
Ciao, Thorsten
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [regression] Bug 221745 - PV DomU ballooning driver init issue
2026-07-27 8:42 [regression] Bug 221745 - PV DomU ballooning driver init issue Thorsten Leemhuis
@ 2026-07-27 16:51 ` Roger Pau Monné
2026-07-27 17:10 ` Yannick Martin
0 siblings, 1 reply; 3+ messages in thread
From: Roger Pau Monné @ 2026-07-27 16:51 UTC (permalink / raw)
To: Thorsten Leemhuis
Cc: Juergen Gross, xen-devel@lists.xenproject.org,
Linux kernel regressions list, yannick.martin+kernelorg
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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [regression] Bug 221745 - PV DomU ballooning driver init issue
2026-07-27 16:51 ` Roger Pau Monné
@ 2026-07-27 17:10 ` Yannick Martin
0 siblings, 0 replies; 3+ messages in thread
From: Yannick Martin @ 2026-07-27 17:10 UTC (permalink / raw)
To: Roger Pau Monné, Thorsten Leemhuis
Cc: Juergen Gross, xen-devel@lists.xenproject.org,
Linux kernel regressions list, yannick.martin+kernelorg
[-- Attachment #1: Type: text/plain, Size: 2915 bytes --]
Hello
I will try this tomorrow !
Regards
Le 27 juillet 2026 18:51:15 GMT+02:00, "Roger Pau Monné" <roger.pau@citrix.com> a écrit :
>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;
[-- Attachment #2: Type: text/html, Size: 3670 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-27 18:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-27 8:42 [regression] Bug 221745 - PV DomU ballooning driver init issue Thorsten Leemhuis
2026-07-27 16:51 ` Roger Pau Monné
2026-07-27 17:10 ` Yannick Martin
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.