From: Matthew Wilcox <willy@infradead.org>
To: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Shakeel Butt <shakeel.butt@linux.dev>,
Muchun Song <muchun.song@linux.dev>,
linux-mm@kvack.org, cgroups@vger.kernel.org,
Uladzislau Rezki <urezki@gmail.com>,
Christoph Hellwig <hch@infradead.org>,
Lorenzo Stoakes <lstoakes@gmail.com>
Subject: Re: [PATCH] mm: memcontrol: remove page_memcg()
Date: Tue, 21 May 2024 15:44:21 +0100 [thread overview]
Message-ID: <ZkyzRVe31WLaepSt@casper.infradead.org> (raw)
In-Reply-To: <20240521131556.142176-1-wangkefeng.wang@huawei.com>
On Tue, May 21, 2024 at 09:15:56PM +0800, Kefeng Wang wrote:
> The page_memcg() only called by mod_memcg_page_state(), so squash it to
> cleanup page_memcg().
This isn't wrong, except that the entire usage of memcg is wrong in the
only two callers of mod_memcg_page_state():
$ git grep mod_memcg_page_state
include/linux/memcontrol.h:static inline void mod_memcg_page_state(struct page *page,
include/linux/memcontrol.h:static inline void mod_memcg_page_state(struct page *page,
mm/vmalloc.c: mod_memcg_page_state(page, MEMCG_VMALLOC, -1);
mm/vmalloc.c: mod_memcg_page_state(area->pages[i], MEMCG_VMALLOC, 1);
The memcg should not be attached to the individual pages that make up a
vmalloc allocation. Rather, it should be managed by the vmalloc
allocation itself. I don't have the knowledge to poke around inside
vmalloc right now, but maybe somebody else could take that on.
next prev parent reply other threads:[~2024-05-21 14:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-21 13:15 Kefeng Wang
2024-05-21 13:30 ` Michal Hocko
2024-05-21 14:21 ` Matthew Wilcox
2024-05-23 9:43 ` Kefeng Wang
2024-05-21 14:44 ` Matthew Wilcox [this message]
2024-05-21 16:03 ` Michal Hocko
2024-05-21 19:29 ` Shakeel Butt
2024-05-23 8:57 ` Kefeng Wang
2024-05-23 13:31 ` Matthew Wilcox
2024-05-23 15:41 ` Shakeel Butt
2024-05-23 16:34 ` Matthew Wilcox
2024-05-31 22:51 ` Shakeel Butt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZkyzRVe31WLaepSt@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=hch@infradead.org \
--cc=linux-mm@kvack.org \
--cc=lstoakes@gmail.com \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=urezki@gmail.com \
--cc=wangkefeng.wang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox