]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
memcg: Convert count_memcg_page_event() to count_memcg_folio_event()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 3 Jan 2023 04:19:20 +0000 (23:19 -0500)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 3 Jan 2023 04:19:20 +0000 (23:19 -0500)
The only caller now has a folio so convert the function to take a folio.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
include/linux/memcontrol.h
mm/khugepaged.c

index d3c8203cab6ce7330febe3c0ff58656432ad9b91..0714e09977c246c013255bc562b29a3c02c61143 100644 (file)
@@ -1065,10 +1065,10 @@ static inline void count_memcg_events(struct mem_cgroup *memcg,
        local_irq_restore(flags);
 }
 
-static inline void count_memcg_page_event(struct page *page,
+static inline void count_memcg_folio_event(struct folio *folio,
                                          enum vm_event_item idx)
 {
-       struct mem_cgroup *memcg = page_memcg(page);
+       struct mem_cgroup *memcg = folio_memcg(folio);
 
        if (memcg)
                count_memcg_events(memcg, idx, 1);
@@ -1550,7 +1550,7 @@ static inline void __count_memcg_events(struct mem_cgroup *memcg,
 {
 }
 
-static inline void count_memcg_page_event(struct page *page,
+static inline void count_memcg_folio_event(struct folio *folio,
                                          int idx)
 {
 }
index a1aa06a55466d4b6ce33ec9e9e51e13fbc8f5af1..36d4a12d2da095e89d5ee7dd94dabada70c3ce73 100644 (file)
@@ -956,7 +956,7 @@ static int alloc_charge_hpage(struct page **hpage, struct mm_struct *mm,
        *hpage = &folio->page;
        if (unlikely(mem_cgroup_charge(folio, mm, gfp)))
                return SCAN_CGROUP_CHARGE_FAIL;
-       count_memcg_page_event(&folio->page, THP_COLLAPSE_ALLOC);
+       count_memcg_folio_event(folio, THP_COLLAPSE_ALLOC);
        return SCAN_SUCCEED;
 }