Skip to contentSkip to conversation

mm/balloon: fix NR_BALLOON_PAGES accounting on migration failure

PATCH NAK [email protected] 4 participants 5 messages Nov 14 – Nov 20

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

Fixes 4d689474e1b2 ("balloon_compaction: update the NR_BALLOON_PAGES state")

---
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
index 96a8f1e20bc66ae46a571a4f51243789bb362925..44c211ba8e6b0b86236ec0e05ca1eb4b9c444a8e 100644
@@ -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
#1 lore raw
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_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.

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")

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

#2 lore raw
Quoted 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_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.

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")

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
#3 lore raw
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

#4 lore raw
In reply to [email protected]
Thank 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_PAGES accounting on migration failure

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.

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")

[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