[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250314213757.244258-3-npache@redhat.com>
Date: Fri, 14 Mar 2025 15:37:55 -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 2/4] 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.
Signed-off-by: Nico Pache <npache@...hat.com>
---
mm/balloon_compaction.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/balloon_compaction.c b/mm/balloon_compaction.c
index 6597ebea8ae2..d3e00731e262 100644
--- a/mm/balloon_compaction.c
+++ b/mm/balloon_compaction.c
@@ -24,6 +24,7 @@ static void balloon_page_enqueue_one(struct balloon_dev_info *b_dev_info,
balloon_page_insert(b_dev_info, page);
unlock_page(page);
__count_vm_event(BALLOON_INFLATE);
+ inc_node_page_state(page, NR_BALLOON_PAGES);
}
/**
@@ -103,6 +104,7 @@ size_t balloon_page_list_dequeue(struct balloon_dev_info *b_dev_info,
__count_vm_event(BALLOON_DEFLATE);
list_add(&page->lru, pages);
unlock_page(page);
+ dec_node_page_state(page, NR_BALLOON_PAGES);
n_pages++;
}
spin_unlock_irqrestore(&b_dev_info->pages_lock, flags);
--
2.48.1
Powered by blists - more mailing lists