Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/balloon: fix NR_BALLOON_PAGES accounting on migration failure
@ 2026-11-14 16:47 shao.mingyin
  2026-11-14 17:31 ` Lorenzo Stoakes (ARM)
  2026-11-15 16:47 ` sashiko-bot
  0 siblings, 2 replies; 5+ messages in thread
From: shao.mingyin @ 2026-11-14 16:47 UTC (permalink / raw)
  To: akpm, david; +Cc: linux-mm, virtualization, linux-kernel

From: Shao Mingyin <shao.mingyin@zte.com.cn>

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")
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
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(+)

diff --git a/mm/balloon.c b/mm/balloon.c
index 96a8f1e20bc66ae46a571a4f51243789bb362925..44c211ba8e6b0b86236ec0e05ca1eb4b9c444a8e 100644
--- a/mm/balloon.c
+++ b/mm/balloon.c
@@ -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
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/balloon: fix NR_BALLOON_PAGES accounting on migration failure
  2026-11-14 16:47 [PATCH] mm/balloon: fix NR_BALLOON_PAGES accounting on migration failure shao.mingyin
@ 2026-11-14 17:31 ` Lorenzo Stoakes (ARM)
  2026-11-20  9:59   ` David Hildenbrand (Arm)
  2026-11-15 16:47 ` sashiko-bot
  1 sibling, 1 reply; 5+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-11-14 17:31 UTC (permalink / raw)
  To: shao.mingyin; +Cc: akpm, david, linux-mm, virtualization, linux-kernel

On Sun, Nov 15, 2026 at 12:47:08AM +0800, shao.mingyin@zte.com.cn wrote:
> From: Shao Mingyin <shao.mingyin@zte.com.cn>
>
> 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")
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/balloon: fix NR_BALLOON_PAGES accounting on migration failure
  2026-11-14 16:47 [PATCH] mm/balloon: fix NR_BALLOON_PAGES accounting on migration failure shao.mingyin
  2026-11-14 17:31 ` Lorenzo Stoakes (ARM)
@ 2026-11-15 16:47 ` sashiko-bot
  1 sibling, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-11-15 16:47 UTC (permalink / raw)
  To: shao.mingyin, akpm, david
  Cc: linux-mm, virtualization, Michael S. Tsirkin, Eugenio Perez

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 <shao.mingyin@zte.com.cn>

> 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.
>
> 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 <shao.mingyin@zte.com.cn>

[Severity: Low]
This isn't a bug, but the commit message body repeats the subject line at
the top.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261115004708909xx05JgB9nXnOCG0zL7h_K@zte.com.cn?part=1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/balloon: fix NR_BALLOON_PAGES accounting on migration failure
  2026-11-14 17:31 ` Lorenzo Stoakes (ARM)
@ 2026-11-20  9:59   ` David Hildenbrand (Arm)
  2026-11-20 10:36     ` Lorenzo Stoakes (ARM)
  0 siblings, 1 reply; 5+ messages in thread
From: David Hildenbrand (Arm) @ 2026-11-20  9:59 UTC (permalink / raw)
  To: Lorenzo Stoakes (ARM), shao.mingyin
  Cc: akpm, linux-mm, virtualization, linux-kernel

On 11/14/26 18:31, Lorenzo Stoakes (ARM) wrote:
> On Sun, Nov 15, 2026 at 12:47:08AM +0800, shao.mingyin@zte.com.cn wrote:
>> From: Shao Mingyin <shao.mingyin@zte.com.cn>
>>
>> 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")
>> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
> 
> 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...

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.

-- 
Cheers,

David


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/balloon: fix NR_BALLOON_PAGES accounting on migration failure
  2026-11-20  9:59   ` David Hildenbrand (Arm)
@ 2026-11-20 10:36     ` Lorenzo Stoakes (ARM)
  0 siblings, 0 replies; 5+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-11-20 10:36 UTC (permalink / raw)
  To: David Hildenbrand (Arm)
  Cc: shao.mingyin, akpm, linux-mm, virtualization, linux-kernel

On Fri, Nov 20, 2026 at 10:59:47AM +0100, David Hildenbrand (Arm) wrote:
> On 11/14/26 18:31, Lorenzo Stoakes (ARM) wrote:
> > 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...
>
> 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.

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-20 10:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14 16:47 [PATCH] mm/balloon: fix NR_BALLOON_PAGES accounting on migration failure shao.mingyin
2026-11-14 17:31 ` Lorenzo Stoakes (ARM)
2026-11-20  9:59   ` David Hildenbrand (Arm)
2026-11-20 10:36     ` Lorenzo Stoakes (ARM)
2026-11-15 16:47 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox