aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Shi (tencent) <[email protected]>2024-04-11 14:17:03 +0800
committerAndrew Morton <[email protected]>2024-05-05 17:53:32 -0700
commitf39b6e2dc18efcc7f8d55cdf62c8c6cad47d1f06 (patch)
treec9158277cafdb994b473cbddde83ecd23e091c8d
parentb91f94729d050eec86ae7ef084aa3805146c0a67 (diff)
mm/ksm: use folio in remove_rmap_item_from_tree
To save 2 compound_head calls. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Alex Shi (tencent) <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Cc: Izik Eidus <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Chris Wright <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--mm/ksm.c10
1 files 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--;