mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Julian Sun <sunjunchao@bytedance.com>
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, lance.yang@linux.dev,
	mhiramat@kernel.org, yangyicong@hisilicon.com, will@kernel.org,
	dianders@chromium.org, mingo@kernel.org, lihuafei1@huawei.com,
	hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev,
	shakeel.butt@linux.dev, muchun.song@linux.dev, tj@kernel.org
Subject: Re: [PATCH v2 2/2] memcg: Don't trigger hung task warnings when memcg is releasing resources.
Date: Wed, 24 Sep 2025 08:32:19 +0200	[thread overview]
Message-ID: <20250924063219.GR4067720@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250924034100.3701520-3-sunjunchao@bytedance.com>

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@bytedance.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
> 

  reply	other threads:[~2025-09-24  6:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24  3:40 [PATCH v2 0/2] Suppress undesirable hung task warnings Julian Sun
2025-09-24  3:40 ` [PATCH v2 1/2] hung_task: Introduce touch_hung_task_detector() Julian Sun
2025-09-25 13:33   ` Masami Hiramatsu
2025-09-24  3:41 ` [PATCH v2 2/2] memcg: Don't trigger hung task warnings when memcg is releasing resources Julian Sun
2025-09-24  6:32   ` Peter Zijlstra [this message]
2025-09-24  7:50     ` [External] " Julian Sun
2025-09-24  8:28       ` Peter Zijlstra
2025-09-24 10:36         ` Julian Sun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250924063219.GR4067720@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=hannes@cmpxchg.org \
    --cc=lance.yang@linux.dev \
    --cc=lihuafei1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mhocko@kernel.org \
    --cc=mingo@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=sunjunchao@bytedance.com \
    --cc=tj@kernel.org \
    --cc=will@kernel.org \
    --cc=yangyicong@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®