lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250314213757.244258-4-npache@redhat.com>
Date: Fri, 14 Mar 2025 15:37:56 -0600
From: Nico Pache <npache@...hat.com>
To: linux-hyperv@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	xen-devel@...ts.xenproject.org,
	linux-fsdevel@...r.kernel.org,
	linux-mm@...ck.org,
	virtualization@...ts.linux.dev
Cc: alexander.atanasov@...tuozzo.com,
	muchun.song@...ux.dev,
	roman.gushchin@...ux.dev,
	mhocko@...nel.org,
	kys@...rosoft.com,
	haiyangz@...rosoft.com,
	wei.liu@...nel.org,
	decui@...rosoft.com,
	jgross@...e.com,
	sstabellini@...nel.org,
	oleksandr_tyshchenko@...m.com,
	akpm@...ux-foundation.org,
	mst@...hat.com,
	david@...hat.com,
	yosry.ahmed@...ux.dev,
	hannes@...xchg.org,
	nphamcs@...il.com,
	chengming.zhou@...ux.dev,
	kanchana.p.sridhar@...el.com,
	llong@...hat.com,
	shakeel.butt@...ux.dev
Subject: [PATCH v2 3/4] hv_balloon: update the NR_BALLOON_PAGES state

Update the NR_BALLOON_PAGES counter when pages are added to or
removed from the Hyper-V balloon.

Signed-off-by: Nico Pache <npache@...hat.com>
---
 drivers/hv/hv_balloon.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index fec2f18679e3..2b4080e51f97 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -1192,6 +1192,7 @@ static void free_balloon_pages(struct hv_dynmem_device *dm,
 		__ClearPageOffline(pg);
 		__free_page(pg);
 		dm->num_pages_ballooned--;
+		mod_node_page_state(page_pgdat(pg), NR_BALLOON_PAGES, -1);
 		adjust_managed_page_count(pg, 1);
 	}
 }
@@ -1221,6 +1222,7 @@ static unsigned int alloc_balloon_pages(struct hv_dynmem_device *dm,
 			return i * alloc_unit;
 
 		dm->num_pages_ballooned += alloc_unit;
+		mod_node_page_state(page_pgdat(pg), NR_BALLOON_PAGES, alloc_unit);
 
 		/*
 		 * If we allocatted 2M pages; split them so we
-- 
2.48.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ