[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411061713.1847574-3-alexs@kernel.org>
Date: Thu, 11 Apr 2024 14:17:03 +0800
From: alexs@...nel.org
To: Andrew Morton <akpm@...ux-foundation.org>,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
zik.eidus@...ellosystems.com,
willy@...radead.org,
aarcange@...hat.com,
hughd@...gle.com,
chrisw@...s-sol.org,
david@...hat.com
Cc: "Alex Shi (tencent)" <alexs@...nel.org>,
Izik Eidus <izik.eidus@...ellosystems.com>
Subject: [PATCH v5 02/10] mm/ksm: use folio in remove_rmap_item_from_tree
From: "Alex Shi (tencent)" <alexs@...nel.org>
To save 2 compound_head calls.
Signed-off-by: Alex Shi (tencent) <alexs@...nel.org>
Cc: Izik Eidus <izik.eidus@...ellosystems.com>
Cc: Matthew Wilcox <willy@...radead.org>
Cc: Andrea Arcangeli <aarcange@...hat.com>
Cc: Hugh Dickins <hughd@...gle.com>
Cc: Chris Wright <chrisw@...s-sol.org>
Reviewed-by: David Hildenbrand <david@...hat.com>
---
mm/ksm.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/mm/ksm.c b/mm/ksm.c
index ac126a4c245c..ef5c4b6d377c 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1006,16 +1006,16 @@ static void remove_rmap_item_from_tree(struct ksm_rmap_item *rmap_item)
{
if (rmap_item->address & STABLE_FLAG) {
struct ksm_stable_node *stable_node;
- struct page *page;
+ struct folio *folio;
stable_node = rmap_item->head;
- page = get_ksm_page(stable_node, GET_KSM_PAGE_LOCK);
- if (!page)
+ folio = ksm_get_folio(stable_node, GET_KSM_PAGE_LOCK);
+ if (!folio)
goto out;
hlist_del(&rmap_item->hlist);
- unlock_page(page);
- put_page(page);
+ folio_unlock(folio);
+ folio_put(folio);
if (!hlist_empty(&stable_node->hlist))
ksm_pages_sharing--;
--
2.43.0
Powered by blists - more mailing lists