aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Pache <[email protected]>2025-03-14 21:37:57 +0000
committerAndrew Morton <[email protected]>2025-03-22 05:03:13 +0000
commitf6a09e6800936c6c9ba5667ac3efc18feb8f3a2f (patch)
tree4d71d2e6db5001cfa3582893fcd6fe50cf91d064
parenthv_balloon: update the NR_BALLOON_PAGES state (diff)
downloadkernel-f6a09e6800936c6c9ba5667ac3efc18feb8f3a2f.tar.gz
kernel-f6a09e6800936c6c9ba5667ac3efc18feb8f3a2f.zip
xen: balloon: update the NR_BALLOON_PAGES state
Update the NR_BALLOON_PAGES counter when pages are added to or removed from the Xen balloon. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Nico Pache <[email protected]> Reviewed-by: Juergen Gross <[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]> Cc: Michael Kelley <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--drivers/xen/balloon.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 163f7f1d70f1..65d4e7fa1eb8 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -157,6 +157,8 @@ static void balloon_append(struct page *page)
list_add(&page->lru, &ballooned_pages);
balloon_stats.balloon_low++;
}
+ inc_node_page_state(page, NR_BALLOON_PAGES);
+
wake_up(&balloon_wq);
}
@@ -179,6 +181,8 @@ static struct page *balloon_retrieve(bool require_lowmem)
balloon_stats.balloon_low--;
__ClearPageOffline(page);
+ dec_node_page_state(page, NR_BALLOON_PAGES);
+
return page;
}