Skip to content

Commit 02ec359

Browse files
PacheNicoakpm00
authored andcommitted
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. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Nico Pache <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Cc: Alexander Atanasov <[email protected]> Cc: Chengming Zhou <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Dexuan Cui <[email protected]> Cc: Haiyang Zhang <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Juegren Gross <[email protected]> Cc: Kanchana P Sridhar <[email protected]> Cc: K. Y. Srinivasan <[email protected]> Cc: "Michael S. Tsirkin" <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Muchun Song <[email protected]> Cc: Nhat Pham <[email protected]> Cc: Oleksandr Tyshchenko <[email protected]> Cc: Roman Gushchin <[email protected]> Cc: Shakeel Butt <[email protected]> Cc: Stefano Stabellini <[email protected]> Cc: Wei Liu <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 4d68947 commit 02ec359

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/hv/hv_balloon.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,7 @@ static void free_balloon_pages(struct hv_dynmem_device *dm,
11921192
__ClearPageOffline(pg);
11931193
__free_page(pg);
11941194
dm->num_pages_ballooned--;
1195+
mod_node_page_state(page_pgdat(pg), NR_BALLOON_PAGES, -1);
11951196
adjust_managed_page_count(pg, 1);
11961197
}
11971198
}
@@ -1221,6 +1222,7 @@ static unsigned int alloc_balloon_pages(struct hv_dynmem_device *dm,
12211222
return i * alloc_unit;
12221223

12231224
dm->num_pages_ballooned += alloc_unit;
1225+
mod_node_page_state(page_pgdat(pg), NR_BALLOON_PAGES, alloc_unit);
12241226

12251227
/*
12261228
* If we allocatted 2M pages; split them so we

0 commit comments

Comments
 (0)