Skip to content

Commit 4d68947

Browse files
PacheNicoakpm00
authored andcommitted
balloon_compaction: update the NR_BALLOON_PAGES state
Update the NR_BALLOON_PAGES counter when pages are added or removed using the balloon compaction interface. The virtio, Vmware, and pseries-cmm balloon drivers utilize the balloon_compaction interface to allocate and free balloon pages. Other balloon drivers will have to maintain this counter manually. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Nico Pache <[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]>
1 parent 835de37 commit 4d68947

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mm/balloon_compaction.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ static void balloon_page_enqueue_one(struct balloon_dev_info *b_dev_info,
2424
balloon_page_insert(b_dev_info, page);
2525
unlock_page(page);
2626
__count_vm_event(BALLOON_INFLATE);
27+
inc_node_page_state(page, NR_BALLOON_PAGES);
2728
}
2829

2930
/**
@@ -103,6 +104,7 @@ size_t balloon_page_list_dequeue(struct balloon_dev_info *b_dev_info,
103104
__count_vm_event(BALLOON_DEFLATE);
104105
list_add(&page->lru, pages);
105106
unlock_page(page);
107+
dec_node_page_state(page, NR_BALLOON_PAGES);
106108
n_pages++;
107109
}
108110
spin_unlock_irqrestore(&b_dev_info->pages_lock, flags);

0 commit comments

Comments
 (0)