mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2026-01-27 12:47:24 +01:00
memcg: don't call propagate_protected_usage() for v1
Patch series "page_counter cleanup and size reduction".
Commit c6f53ed8f2 ("mm, memcg: cg2 memory{.swap,}.peak write handlers")
accidently increased the size of struct page_counter. This series
rearrange the fields to reduce its size and also has some cleanups.
This patch (of 3):
Memcg-v1 does not support memory protection (min/low) and thus there is no
need to track protected memory usage for it.
Link: https://lkml.kernel.org/r/20250228075808.207484-1-shakeel.butt@linux.dev
Link: https://lkml.kernel.org/r/20250228075808.207484-2-shakeel.butt@linux.dev
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin (Cruise) <roman.gushchin@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
a14efee047
commit
645207a670
|
|
@ -3610,6 +3610,7 @@ mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
|
|||
{
|
||||
struct mem_cgroup *parent = mem_cgroup_from_css(parent_css);
|
||||
struct mem_cgroup *memcg, *old_memcg;
|
||||
bool memcg_on_dfl = cgroup_subsys_on_dfl(memory_cgrp_subsys);
|
||||
|
||||
old_memcg = set_active_memcg(parent);
|
||||
memcg = mem_cgroup_alloc(parent);
|
||||
|
|
@ -3627,7 +3628,7 @@ mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
|
|||
if (parent) {
|
||||
WRITE_ONCE(memcg->swappiness, mem_cgroup_swappiness(parent));
|
||||
|
||||
page_counter_init(&memcg->memory, &parent->memory, true);
|
||||
page_counter_init(&memcg->memory, &parent->memory, memcg_on_dfl);
|
||||
page_counter_init(&memcg->swap, &parent->swap, false);
|
||||
#ifdef CONFIG_MEMCG_V1
|
||||
WRITE_ONCE(memcg->oom_kill_disable, READ_ONCE(parent->oom_kill_disable));
|
||||
|
|
@ -3647,7 +3648,7 @@ mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
|
|||
return &memcg->css;
|
||||
}
|
||||
|
||||
if (cgroup_subsys_on_dfl(memory_cgrp_subsys) && !cgroup_memory_nosocket)
|
||||
if (memcg_on_dfl && !cgroup_memory_nosocket)
|
||||
static_branch_inc(&memcg_sockets_enabled_key);
|
||||
|
||||
if (!cgroup_memory_nobpf)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user