Skip to content

Commit 0d2a260

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
mm: remove references to folio in __memcg_kmem_uncharge_page()
This use of folios is misleading because these pages are not part of a folio. Remove an unnecessary call to page_folio(), saving 58 bytes of text in a Debian kernel build. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Acked-by: Johannes Weiner <[email protected]> Acked-by: Shakeel Butt <[email protected]> Acked-by: Roman Gushchin <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Muchun Song <[email protected]> Cc: Zi Yan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 8492936 commit 0d2a260

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

mm/memcontrol.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2726,16 +2726,14 @@ int __memcg_kmem_charge_page(struct page *page, gfp_t gfp, int order)
27262726
*/
27272727
void __memcg_kmem_uncharge_page(struct page *page, int order)
27282728
{
2729-
struct folio *folio = page_folio(page);
2730-
struct obj_cgroup *objcg;
2729+
struct obj_cgroup *objcg = page_objcg(page);
27312730
unsigned int nr_pages = 1 << order;
27322731

2733-
if (!folio_memcg_kmem(folio))
2732+
if (!objcg)
27342733
return;
27352734

2736-
objcg = __folio_objcg(folio);
27372735
obj_cgroup_uncharge_pages(objcg, nr_pages);
2738-
folio->memcg_data = 0;
2736+
page->memcg_data = 0;
27392737
obj_cgroup_put(objcg);
27402738
}
27412739

0 commit comments

Comments
 (0)