memcg: convert mem_cgroup_move_charge_pte_range() to use a folio
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 11 Jan 2024 18:12:16 +0000 (18:12 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 Feb 2024 00:00:03 +0000 (16:00 -0800)
commitb267e1a3e45fcc75fa1434d5c978b36624324e58
treee523f8c09b6336e3ccc60b4828ae6ff5e4db322f
parent05976a42b327d4f5a529a5e55cb8bfc2fa0bcca1
memcg: convert mem_cgroup_move_charge_pte_range() to use a folio

Patch series "Convert memcontrol charge moving to use folios".

No part of these patches should change behaviour; all the called functions
already convert from page to folio, so this ought to simply be a reduction
in the number of calls to compound_head().

This patch (of 4):

Remove many calls to compound_head() by calling page_folio() once at the
start of each stanza which receives a struct page from 'target'.  There
should be no change in behaviour here as all the called functions start
out by converting the page to its folio.

Link: https://lkml.kernel.org/r/20240111181219.3462852-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20240111181219.3462852-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>
Reviewed-by: Muchun Song <muchun.song@linux.dev>
Acked-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c