mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Tejun Heo <tj@kernel.org>
Cc: mingo@kernel.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	vschneid@redhat.com, kprateek.nayak@amd.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/7] sched/core: Simplify/fix time updates
Date: Wed, 2 Sep 2026 16:32:09 +0200	[thread overview]
Message-ID: <20260902143209.GC687043@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <ape2abNdAgRCfEtg@slm.duckdns.org>

On Tue, Sep 01, 2026 at 07:38:49PM -1000, Tejun Heo wrote:
> Hello,
> 
> On Fri, Aug 28, 2026 at 12:17:01PM +0200, Peter Zijlstra wrote:
> > +static void opt_update_rq_clock(struct rq *rq)
> > +{
> > +	if (!(rq->clock_update_flags & RQCF_UPDATED))
> > +		update_rq_clock(rq);
> > +}
> 
> Yeah, I think this really needs sth like this. That said,
> 
> > @@ -6336,18 +6336,12 @@ pick_next_task(struct rq *rq, struct rq_
> >  		 * pick_next_task(). If the current cpu is not the core,
> >  		 * the core may also have been updated above.
> >  		 */
> > -		if (i != cpu && (rq_i != rq->core || !core_clock_updated))
> > -			update_rq_clock(rq_i);
> > +		opt_update_rq_clock(rq_i);
> 
> I don't think this is correct. A sibling rq wouldn't necessarily have
> RCQF_UPDATED cleared from whenever it scheduled / ticked the last time, so
> the following pick_task() can run with pretty stale rq clock.

Ah, indeed. We should clear clock_update_flags on unlock, rather than on
lock. Thanks!

  reply	other threads:[~2026-09-02 14:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 10:16 [PATCH 0/7] sched: core-sched fixes and balancing Peter Zijlstra
2026-08-28 10:17 ` [PATCH 1/7] sched/core: Fix pick_next_task() self recursion Peter Zijlstra
2026-09-03 11:13   ` Aaron Lu
2026-08-28 10:17 ` [PATCH 2/7] sched/core: Simplify/fix time updates Peter Zijlstra
2026-09-02  5:38   ` Tejun Heo
2026-09-02 14:32     ` Peter Zijlstra [this message]
2026-08-28 10:17 ` [PATCH 3/7] sched/core: Allow newidle for core-sched Peter Zijlstra
2026-08-28 10:17 ` [PATCH 4/7] sched/rt: Add early exit on balance path Peter Zijlstra
2026-08-28 10:17 ` [PATCH 5/7] sched/fair: Reflow pick_task_fair() / newidle Peter Zijlstra
2026-08-28 10:17 ` [PATCH 6/7] sched/fair: Push sched_balance_newidle() unlock down Peter Zijlstra
2026-08-28 10:17 ` [PATCH 7/7] sched: Remove sched_class::balance() Peter Zijlstra
2026-09-01 23:47   ` Tejun Heo

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=20260902143209.GC687043@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tj@kernel.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

all inboxes | Powered by JetHome®