* + mm-memcg-dont-periodically-flush-stats-when-memcg-is-disabled.patch added to mm-unstable branch
@ 2024-01-28 8:02 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2024-01-28 8:02 UTC (permalink / raw)
To: mm-commits, shakeelb, roman.gushchin, muchun.song, minchan,
mhocko, hannes, chrisl, tjmercier, akpm
The patch titled
Subject: mm: memcg: don't periodically flush stats when memcg is disabled
has been added to the -mm mm-unstable branch. Its filename is
mm-memcg-dont-periodically-flush-stats-when-memcg-is-disabled.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-memcg-dont-periodically-flush-stats-when-memcg-is-disabled.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: "T.J. Mercier" <tjmercier@google.com>
Subject: mm: memcg: don't periodically flush stats when memcg is disabled
Date: Fri, 26 Jan 2024 21:19:25 +0000
The root memcg is onlined even when memcg is disabled. When it's onlined
a 2 second periodic stat flush is started, but no stat flushing is
required when memcg is disabled because there can be no child memcgs.
Most calls to flush memcg stats are avoided when memcg is disabled as a
result of the mem_cgroup_disabled check added in 7d7ef0a4686a ("mm: memcg:
restore subtree stats flushing"), but the periodic flushing started in
mem_cgroup_css_online is not. Skip it.
Link: https://lkml.kernel.org/r/20240126211927.1171338-1-tjmercier@google.com
Fixes: aa48e47e3906 ("memcg: infrastructure to flush memcg stats")
Signed-off-by: T.J. Mercier <tjmercier@google.com>
Acked-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Chris Li <chrisl@kernel.org>
Reported-by: Minchan Kim <minchan@google.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/memcontrol.c~mm-memcg-dont-periodically-flush-stats-when-memcg-is-disabled
+++ a/mm/memcontrol.c
@@ -5622,7 +5622,7 @@ static int mem_cgroup_css_online(struct
if (alloc_shrinker_info(memcg))
goto offline_kmem;
- if (unlikely(mem_cgroup_is_root(memcg)))
+ if (unlikely(mem_cgroup_is_root(memcg)) && !mem_cgroup_disabled())
queue_delayed_work(system_unbound_wq, &stats_flush_dwork,
FLUSH_TIME);
lru_gen_online_memcg(memcg);
_
Patches currently in -mm which might be from tjmercier@google.com are
mm-memcg-dont-periodically-flush-stats-when-memcg-is-disabled.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-01-28 8:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-28 8:02 + mm-memcg-dont-periodically-flush-stats-when-memcg-is-disabled.patch added to mm-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.