The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Joseph Salisbury <joseph.salisbury@oracle.com>,
	Ingo Molnar <mingo@redhat.com>
Cc: Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/core: initialize resched_latency in sched_tick()
Date: Wed, 18 Mar 2026 12:00:58 +0530	[thread overview]
Message-ID: <ac345bd3-10f2-4f39-96ad-e8c6698aaf19@linux.ibm.com> (raw)
In-Reply-To: <20260317170943.44c41263@gandalf.local.home>

Hi.

> 
> The code has:
> 
> 	if (sched_feat(LATENCY_WARN))
> 		resched_latency = cpu_resched_latency(rq);
> 	calc_global_load_tick(rq);
> 	sched_core_tick(rq);
> 	scx_tick(rq);
> 
> 	rq_unlock(rq, &rf);
> 
> 	if (sched_feat(LATENCY_WARN) && resched_latency)
> 		resched_latency_warn(cpu, resched_latency);
> 
> 
> I guess if LATENCY_WARN gets enabled between the first check and the
> second, then the resched_latency could be uninitialized.
> 
> Heck, probably could even get rid of the second sched_feat(LATENCY_WARN),
> and make it simply:
> 
> 	if (resched_latency)
> 
> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> 
> -- Steve

Whats the relevance of resched_latency warnings in the age of preempt
kernels being the default for majority of the archs.

In case of full/lazy preemption, at the end of sched_tick itself we would call
schedule if need_resched is set provided it was preemptible.

It kind of makes sense for non preemptive kernels. But we have preemptoff and
preemptirqoff tracers which one could use. (although may need a kernel build)

What bugs is it catching these days?

  reply	other threads:[~2026-03-18  6:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-17 19:58 [PATCH] sched/core: initialize resched_latency in sched_tick() Joseph Salisbury
2026-03-17 21:09 ` Steven Rostedt
2026-03-18  6:30   ` Shrikanth Hegde [this message]
2026-03-18 14:48     ` Steven Rostedt
2026-03-18 14:53       ` Peter Zijlstra

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=ac345bd3-10f2-4f39-96ad-e8c6698aaf19@linux.ibm.com \
    --to=sshegde@linux.ibm.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=joseph.salisbury@oracle.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=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