summaryrefslogtreecommitdiff
path: root/mm/ksm.c
diff options
context:
space:
mode:
authorAlex Shi (tencent) <alexs@kernel.org>2024-04-11 14:17:07 +0800
committerAndrew Morton <akpm@linux-foundation.org>2024-05-05 17:53:33 -0700
commit72556a4c06646b7e314ee0920796699c9d4a8b47 (patch)
treefdb90e72bd44982834846aa2cf20390db7d5e12e /mm/ksm.c
parent6f528de2986e179bf4a100dcc8db2a6703aa7885 (diff)
mm/ksm: use ksm_get_folio in scan_get_next_rmap_item
Save a compound_head call. Link: https://lkml.kernel.org/r/20240411061713.1847574-7-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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/ksm.c b/mm/ksm.c
index 654400f993fc..b127d39c9af0 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -2611,14 +2611,14 @@ static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page)
*/
if (!ksm_merge_across_nodes) {
struct ksm_stable_node *stable_node, *next;
- struct page *page;
+ struct folio *folio;
list_for_each_entry_safe(stable_node, next,
&migrate_nodes, list) {
- page = get_ksm_page(stable_node,
- GET_KSM_PAGE_NOLOCK);
- if (page)
- put_page(page);
+ folio = ksm_get_folio(stable_node,
+ GET_KSM_PAGE_NOLOCK);
+ if (folio)
+ folio_put(folio);
cond_resched();
}
}