[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <40a868bf-61dc-1832-4799-ff85018ebcec@suse.cz>
Date: Wed, 11 Aug 2021 12:54:05 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: "Matthew Wilcox (Oracle)" <willy@...radead.org>,
linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
Christoph Hellwig <hch@....de>,
Michal Hocko <mhocko@...nel.org>,
Johannes Weiner <hannes@...xchg.org>,
Vladimir Davydov <vdavydov.dev@...il.com>
Subject: Re: [PATCH v14 040/138] mm/memcg: Convert mem_cgroup_charge() to take
a folio
On 7/15/21 5:35 AM, Matthew Wilcox (Oracle) wrote:
> Convert all callers of mem_cgroup_charge() to call page_folio() on the
> page they're currently passing in. Many of them will be converted to
> use folios themselves soon.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
> Reviewed-by: Christoph Hellwig <hch@....de>
Acked-by: Vlastimil Babka <vbabka@...e.cz>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index c2ffad021e09..03283d97b62a 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -6681,10 +6681,9 @@ void mem_cgroup_calculate_protection(struct mem_cgroup *root,
> atomic_long_read(&parent->memory.children_low_usage)));
> }
>
> -static int __mem_cgroup_charge(struct page *page, struct mem_cgroup *memcg,
> +static int __mem_cgroup_charge(struct folio *folio, struct mem_cgroup *memcg,
> gfp_t gfp)
The git/next version also renames this function to charge_memcg(), why? The new
name doesn't look that internal as the old one. I don't have a strong opinion
but CCing memcg maintainers who might.
> {
> - struct folio *folio = page_folio(page);
> unsigned int nr_pages = folio_nr_pages(folio);
> int ret;
>
> @@ -6697,27 +6696,27 @@ static int __mem_cgroup_charge(struct page *page, struct mem_cgroup *memcg,
>
> local_irq_disable();
> mem_cgroup_charge_statistics(memcg, nr_pages);
> - memcg_check_events(memcg, page_to_nid(page));
> + memcg_check_events(memcg, folio_nid(folio));
> local_irq_enable();
> out:
> return ret;
> }
>
Powered by blists - more mailing lists