mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: 99090633-b625-ff07-fcf8-500d71f9ae13@google.com
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	 Juri Lelli <juri.lelli@redhat.com>,
	 Vincent Guittot <vincent.guittot@linaro.org>,
	 Dietmar Eggemann <dietmar.eggemann@arm.com>,
	 Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>,  Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	 linux-kernel@vger.kernel.org,
	 Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Subject: Re: [patch 1/2] sched/debug: Change need_resched warnings to pr_err
Date: Tue, 7 Jan 2025 12:13:10 -0800 (PST)	[thread overview]
Message-ID: <54cda6c8-38b5-5a98-5296-df40369889b7@google.com> (raw)
In-Reply-To: <833e94a8-738e-4107-81a9-68314cc99954@linux.ibm.com>

On Wed, 8 Jan 2025, Madadi Vineeth Reddy wrote:

> Hi David Rientjes,
> 
> On 07/01/25 02:09, David Rientjes wrote:
> > need_resched warnings, if enabled, are treated as WARNINGs.  If
> > kernel.panic_on_warn is enabled, then this causes a kernel panic.
> > 
> > It's highly unlikely that a panic is desired for these warnings, only a
> > stack trace is normally required to debug and resolve.
> > 
> > Thus, switch need_resched warnings to simply be a printk with an
> > associated stack trace so they are no longer in scope for panic_on_warn.
> > 
> > Signed-off-by: David Rientjes <rientjes@google.com>
> > ---
> >  kernel/sched/debug.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> > 
> > diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
> > --- a/kernel/sched/debug.c
> > +++ b/kernel/sched/debug.c
> > @@ -1295,8 +1295,10 @@ void resched_latency_warn(int cpu, u64 latency)
> >  {
> >  	static DEFINE_RATELIMIT_STATE(latency_check_ratelimit, 60 * 60 * HZ, 1);
> >  
> > -	WARN(__ratelimit(&latency_check_ratelimit),
> > -	     "sched: CPU %d need_resched set for > %llu ns (%d ticks) "
> > -	     "without schedule\n",
> > -	     cpu, latency, cpu_rq(cpu)->ticks_without_resched);
> > +	if (likely(!__ratelimit(&latency_check_ratelimit)))
> > +		return;
> > +
> > +	pr_err("sched: CPU %d need_resched set for > %llu ns (%d ticks) without schedule\n",
> > +	       cpu, latency, cpu_rq(cpu)->ticks_without_resched);
> 
> LGTM. While this is an issue, it doesn't necessarily indicate a critical failure that would
> require the kernel to panic.
> 
> Nit: Would using pr_warn instead be too lenient in this case?
> 

Thanks!  I pondered the log level here for about five seconds, I'm 
indifferent to pr_err() or pr_warn() :)  Since the stack trace is the most 
critical element of the output here, imo, and it has its own log level, I 
didn't feel strongly for either err or warn.

> Reviewed-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
> 
> Thanks,
> Madadi Vineeth Reddy
> 
> > +	dump_stack();
> >  }
> 
> 

  reply	other threads:[~2025-01-07 20:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-06 20:39 David Rientjes
2025-01-06 21:59 ` Josh Don
2025-01-07 19:18 ` Madadi Vineeth Reddy
2025-01-07 20:13   ` David Rientjes [this message]
2025-01-10  0:24 ` [patch v2] " David Rientjes
2025-01-15  9:17   ` [tip: sched/core] " tip-bot2 for David Rientjes

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=54cda6c8-38b5-5a98-5296-df40369889b7@google.com \
    --to=rientjes@google.com \
    --cc=99090633-b625-ff07-fcf8-500d71f9ae13@google.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vineethr@linux.ibm.com \
    --cc=vschneid@redhat.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®