diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2021-05-01 20:42:23 -0400 |
---|---|---|
committer | Matthew Wilcox (Oracle) <willy@infradead.org> | 2021-09-27 09:27:31 -0400 |
commit | bbc6b703b21963e909f633cf7718903ed5094319 (patch) | |
tree | 076d76592401f7c5343053c9eaf7ed51e5a8251c /mm/memcontrol.c | |
parent | c4ed6ebfcb0929d204ab7548496c0d28bd408b36 (diff) |
mm/memcg: Convert mem_cgroup_uncharge() to take a folio
Convert all the callers to call page_folio(). Most of them were already
using a head page, but a few of them I can't prove were, so this may
actually fix a bug.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 64eac157db79..6321ed6d6e5a 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6858,22 +6858,16 @@ static void uncharge_folio(struct folio *folio, struct uncharge_gather *ug) css_put(&memcg->css); } -/** - * __mem_cgroup_uncharge - uncharge a page - * @page: page to uncharge - * - * Uncharge a page previously charged with __mem_cgroup_charge(). - */ -void __mem_cgroup_uncharge(struct page *page) +void __mem_cgroup_uncharge(struct folio *folio) { struct uncharge_gather ug; - /* Don't touch page->lru of any random page, pre-check: */ - if (!page_memcg(page)) + /* Don't touch folio->lru of any random page, pre-check: */ + if (!folio_memcg(folio)) return; uncharge_gather_clear(&ug); - uncharge_folio(page_folio(page), &ug); + uncharge_folio(folio, &ug); uncharge_batch(&ug); } |