* [PATCH] memcg: bypass root memcg check for skmem charging
@ 2025-02-28 2:23 Shakeel Butt
0 siblings, 0 replies; only message in thread
From: Shakeel Butt @ 2025-02-28 2:23 UTC (permalink / raw)
To: Andrew Morton
Cc: Johannes Weiner, Michal Hocko, Roman Gushchin, Muchun Song,
linux-mm, cgroups, linux-kernel, Meta kernel team
The root memcg is never associated with a socket in mem_cgroup_sk_alloc,
so there is no need to check if the given memcg is root for the skmem
charging code path.
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index f571c67ab088..55b0e9482c00 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4879,7 +4879,7 @@ bool mem_cgroup_charge_skmem(struct mem_cgroup *memcg, unsigned int nr_pages,
if (!cgroup_subsys_on_dfl(memory_cgrp_subsys))
return memcg1_charge_skmem(memcg, nr_pages, gfp_mask);
- if (try_charge(memcg, gfp_mask, nr_pages) == 0) {
+ if (try_charge_memcg(memcg, gfp_mask, nr_pages) == 0) {
mod_memcg_state(memcg, MEMCG_SOCK, nr_pages);
return true;
}
--
2.43.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-02-28 2:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-28 2:23 [PATCH] memcg: bypass root memcg check for skmem charging Shakeel Butt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).