[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250924063219.GR4067720@noisy.programming.kicks-ass.net>
Date: Wed, 24 Sep 2025 08:32:19 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Julian Sun <sunjunchao@...edance.com>
Cc: cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org, lance.yang@...ux.dev,
mhiramat@...nel.org, yangyicong@...ilicon.com, will@...nel.org,
dianders@...omium.org, mingo@...nel.org, lihuafei1@...wei.com,
hannes@...xchg.org, mhocko@...nel.org, roman.gushchin@...ux.dev,
shakeel.butt@...ux.dev, muchun.song@...ux.dev, tj@...nel.org
Subject: Re: [PATCH v2 2/2] memcg: Don't trigger hung task warnings when
memcg is releasing resources.
On Wed, Sep 24, 2025 at 11:41:00AM +0800, Julian Sun wrote:
> Hung task warning in mem_cgroup_css_free() is undesirable and
> unnecessary since the behavior of waiting for a long time is
> expected.
>
> Use touch_hung_task_detector() to eliminate the possible
> hung task warning.
>
> Signed-off-by: Julian Sun <sunjunchao@...edance.com>
Still hate this. It is not tied to progress. If progress really stalls,
no warning will be given.
> mm/memcontrol.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 8dd7fbed5a94..fc73a56372a4 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -63,6 +63,7 @@
> #include <linux/seq_buf.h>
> #include <linux/sched/isolation.h>
> #include <linux/kmemleak.h>
> +#include <linux/nmi.h>
> #include "internal.h"
> #include <net/sock.h>
> #include <net/ip.h>
> @@ -3912,8 +3913,15 @@ static void mem_cgroup_css_free(struct cgroup_subsys_state *css)
> int __maybe_unused i;
>
> #ifdef CONFIG_CGROUP_WRITEBACK
> - for (i = 0; i < MEMCG_CGWB_FRN_CNT; i++)
> + for (i = 0; i < MEMCG_CGWB_FRN_CNT; i++) {
> + /*
> + * We don't want the hung task detector to report warnings
> + * here since there's nothing wrong if the writeback work
> + * lasts for a long time.
> + */
> + touch_hung_task_detector(current);
> wb_wait_for_completion(&memcg->cgwb_frn[i].done);
> + }
> #endif
> if (cgroup_subsys_on_dfl(memory_cgrp_subsys) && !cgroup_memory_nosocket)
> static_branch_dec(&memcg_sockets_enabled_key);
> --
> 2.39.5
>
Powered by blists - more mailing lists