aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Shi (tencent) <[email protected]>2024-04-11 14:17:04 +0800
committerAndrew Morton <[email protected]>2024-05-05 17:53:33 -0700
commitb8b0ff244ddca0d475c91c9accf144e25311a951 (patch)
treeb56ca5bc5b633a0327837ab45c37d945537602fd
parentf39b6e2dc18efcc7f8d55cdf62c8c6cad47d1f06 (diff)
mm/ksm: add folio_set_stable_node
Turn set_page_stable_node() into a wrapper folio_set_stable_node, and then use it to replace the former. we will merge them together after all place converted to folio. 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.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mm/ksm.c b/mm/ksm.c
index ef5c4b6d377c..3c52bf9df84c 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1109,6 +1109,12 @@ static inline void set_page_stable_node(struct page *page,
page->mapping = (void *)((unsigned long)stable_node | PAGE_MAPPING_KSM);
}
+static inline void folio_set_stable_node(struct folio *folio,
+ struct ksm_stable_node *stable_node)
+{
+ set_page_stable_node(&folio->page, stable_node);
+}
+
#ifdef CONFIG_SYSFS
/*
* Only called through the sysfs control interface:
@@ -3241,7 +3247,7 @@ void folio_migrate_ksm(struct folio *newfolio, struct folio *folio)
* has gone stale (or that folio_test_swapcache has been cleared).
*/
smp_wmb();
- set_page_stable_node(&folio->page, NULL);
+ folio_set_stable_node(folio, NULL);
}
}
#endif /* CONFIG_MIGRATION */