]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
memcg: Convert mem_cgroup_from_obj_folio() to mem_cgroup_from_obj_slab()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 13 Nov 2025 00:09:28 +0000 (00:09 +0000)
committerVlastimil Babka <vbabka@suse.cz>
Thu, 13 Nov 2025 19:23:09 +0000 (20:23 +0100)
commitb8557d109e7de6962ad4fe217b93316f4e659130
tree4b7aa6806e3b06204d7e6bac9a549b83fefe173f
parent5934b1be8dbe67fa728eff0e68cbafb958c55aa5
memcg: Convert mem_cgroup_from_obj_folio() to mem_cgroup_from_obj_slab()

In preparation for splitting struct slab from struct page and struct
folio, convert the pointer to a slab rather than a folio.  This means
we can end up passing a NULL slab pointer to mem_cgroup_from_obj_slab()
if the pointer is not to a page allocated to slab, and we handle that
appropriately by returning NULL.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: cgroups@vger.kernel.org
Link: https://patch.msgid.link/20251113000932.1589073-15-willy@infradead.org
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/memcontrol.c