Commit 72556a4c authored by Alex Shi (tencent)'s avatar Alex Shi (tencent) Committed by Andrew Morton

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.orgSigned-off-by: default avatarAlex Shi (tencent) <alexs@kernel.org>
Reviewed-by: default avatarDavid 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: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 6f528de2
......@@ -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();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment