mm/balloon: fix NR_BALLOON_PAGES accounting on migration failure
Subsystems (3)
PATCH 1/1 mm/balloon: fix NR_BALLOON_PAGES accounting on migration failure
From: Shao Mingyin <[email protected]>
mm/balloon: fix NR_BALLOON_PAGES accounting on migration failure
A balloon driver's -ENOENT migration result means that the old page was deflated but the replacement was not inflated. vmw_balloon returns this when its deflate operation succeeds and the subsequent inflate fails.
balloon_page_migrate() accounts the deflation and frees the old page, but does not decrement NR_BALLOON_PAGES. Each such failure therefore leaves one extra page in the per-node count, which also contributes to the Balloon value in /proc/meminfo.
Decrement the counter on the old page's node, matching normal dequeue accounting.
---
Build-tested mm/balloon.o with W=1 and CONFIG_BALLOON_MIGRATION=y on x86_64. The vmw_balloon -ENOENT callback path was reviewed statically. No VMware hardware or hypervisor runtime test was performed.
mm/balloon.c | 1 + 1 file changed, 1 insertion(+)
mm/balloon.c +1 -0
@@ -313,6 +313,7 @@ static int balloon_page_migrate(struct page *newpage, struct page *page, }else {/* Old page was deflated but new page not inflated. */ __count_vm_event (BALLOON_DEFLATE ); +dec_node_page_state (page,NR_BALLOON_PAGES );if (b_dev_info->adjust_managed_page_count)adjust_managed_page_count (page,1 );
base-commit: 84abb955b1015477aa11a96e2f3ac1b938b77f48
Signature · 1 line
2.43.0
Quoted 13 lines · On Sun, Nov 15, 2026 at 12:47:08AM +0800, [email protected] wrote:
From: Shao Mingyin <[email protected]>
mm/balloon: fix
NR_BALLOON_PAGESaccounting on migration failureA balloon driver's
-ENOENTmigration result means that the old page was deflated but the replacement was not inflated.vmw_balloonreturns this when its deflate operation succeeds and the subsequent inflate fails.
balloon_page_migrate()accounts the deflation and frees the old page, but does not decrementNR_BALLOON_PAGES. Each such failure therefore leaves one extra page in the per-node count, which also contributes to the Balloon value in/proc/meminfo.
Quoted 5 lines
Decrement the counter on the old page's node, matching normal dequeue accounting.
Fixes 4d689474e1b2 ("balloon_compaction: update the NR_BALLOON_PAGES state")Signed-off-by Shao Mingyin <[email protected]>
NAK.
this is generated by some AI slopper's script, spamming the kernel. The patches I looked at were wrong/broken, so no to anything from this person.
They've sent 300 mails in under four weeks spanniing: ata, scsi, target, ufs, nvme/nvmet, ubifs, ublk, zloop, dm, md, mmc, virtio-blk, mfd, gpio, pwm, spi, PCI, ASoC, ACPI, net, vfs mount, block partitions, and now mm.
and 17 series across 7 subsystems over the past 23 hours.
We need a way to ban emails from people like this...
--
Cheers, Lorenzo
David Hildenbrand (Arm)
maintainerQuoted 25 lines · Lorenzo Stoakes (ARM)
Quoted 13 lines · On Sun, Nov 15, 2026 at 12:47:08AM +0800, [email protected] wrote:
From: Shao Mingyin <[email protected]>
mm/balloon: fix
NR_BALLOON_PAGESaccounting on migration failureA balloon driver's
-ENOENTmigration result means that the old page was deflated but the replacement was not inflated.vmw_balloonreturns this when its deflate operation succeeds and the subsequent inflate fails.
balloon_page_migrate()accounts the deflation and frees the old page, but does not decrementNR_BALLOON_PAGES. Each such failure therefore leaves one extra page in the per-node count, which also contributes to the Balloon value in/proc/meminfo.Quoted 5 lines
Decrement the counter on the old page's node, matching normal dequeue accounting.
Fixes 4d689474e1b2 ("balloon_compaction: update the NR_BALLOON_PAGES state")Signed-off-by Shao Mingyin <[email protected]>NAK.
this is generated by some AI slopper's script, spamming the kernel. The patches I looked at were wrong/broken, so no to anything from this person.
Quoted 7 lines
They've sent 300 mails in under four weeks spanniing: ata, scsi, target, ufs, nvme/nvmet, ubifs, ublk, zloop, dm, md, mmc, virtio-blk, mfd, gpio, pwm, spi, PCI, ASoC, ACPI, net, vfs mount, block partitions, and now mm.
and 17 series across 7 subsystems over the past 23 hours.
We need a way to ban emails from people like this...
Yeah, that's absolutely annoying. In particular as we REQUIRE people to understand the changes they submit, and own the code.
That clearly won't happen in this case.
There is a real (low prio) bug hiding in there, so something to be fixed. I'll take care of it.
I'll take care of it.
Signature · 3 lines
Cheers, David
Quoted 17 lines · David Hildenbrand (Arm)
Quoted 5 lines · Lorenzo Stoakes (ARM)
NAK.
this is generated by some AI slopper's script, spamming the kernel. The patches I looked at were wrong/broken, so no to anything from this person.
Quoted 7 lines
They've sent 300 mails in under four weeks spanniing: ata, scsi, target, ufs, nvme/nvmet, ubifs, ublk, zloop, dm, md, mmc, virtio-blk, mfd, gpio, pwm, spi, PCI, ASoC, ACPI, net, vfs mount, block partitions, and now mm.
and 17 series across 7 subsystems over the past 23 hours.
We need a way to ban emails from people like this...
Yeah, that's absolutely annoying. In particular as we REQUIRE people to understand the changes they submit, and own the code.
Quoted 6 lines
That clearly won't happen in this case.
There is a real (low prio) bug hiding in there, so something to be fixed. I'll take care of it.
I'll take care of it.
Ack, yeah, I think the best approach is to treat these as reports, and if there's anything valid pull that out for a member of the core team :)
--
Cheers, Lorenzo
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] mm/balloon: duplicate subject line in commit message body --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] mm/balloon: duplicate subject line in commit message body --
commit d7902e64fbea27d19919ebb1f5426990572ba432
Author: Shao Mingyin <[email protected]>
Quoted 13 lines
mm/balloon: fix
NR_BALLOON_PAGESaccounting on migration failuremm/balloon: fix
NR_BALLOON_PAGESaccounting on migration failureA balloon driver's
-ENOENTmigration result means that the old page was deflated but the replacement was not inflated.vmw_balloonreturns this when its deflate operation succeeds and the subsequent inflate fails.
balloon_page_migrate()accounts the deflation and frees the old page, but does not decrementNR_BALLOON_PAGES. Each such failure therefore leaves one extra page in the per-node count, which also contributes to the Balloon value in/proc/meminfo.
Quoted 5 lines
Decrement the counter on the old page's node, matching normal dequeue accounting.
Fixes 4d689474e1b2 ("balloon_compaction: update the NR_BALLOON_PAGES state")Signed-off-by Shao Mingyin <[email protected]>
[Severity: Low]
This isn't a bug, but the commit message body repeats the subject line at the top.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1