diff options
author | Alex Shi (tencent) <alexs@kernel.org> | 2024-04-11 08:17:03 +0200 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-05-06 02:53:32 +0200 |
commit | f39b6e2dc18efcc7f8d55cdf62c8c6cad47d1f06 (patch) | |
tree | c9158277cafdb994b473cbddde83ecd23e091c8d /mm/ksm.c | |
parent | mm/ksm: add ksm_get_folio (diff) | |
download | linux-f39b6e2dc18efcc7f8d55cdf62c8c6cad47d1f06.tar.xz linux-f39b6e2dc18efcc7f8d55cdf62c8c6cad47d1f06.zip |
mm/ksm: use folio in remove_rmap_item_from_tree
To save 2 compound_head calls.
Link: https://lkml.kernel.org/r/20240411061713.1847574-3-alexs@kernel.org
Signed-off-by: Alex Shi (tencent) <alexs@kernel.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Izik Eidus <izik.eidus@ravellosystems.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/ksm.c')
-rw-r--r-- | mm/ksm.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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--; |