From: Tejun Heo <tj@kernel.org>
To: Peter Zijlstra <peterz@infradead.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: Tue, 1 Sep 2026 19:38:49 -1000 [thread overview]
Message-ID: <ape2abNdAgRCfEtg@slm.duckdns.org> (raw)
In-Reply-To: <20260828104018.483560652@infradead.org>
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.
>
> - p = pick_task(rq_i, rf);
> + p = pick_task(rq_i, &rf_i);
> if (unlikely(seq != rq->core->core_task_seq ||
> - WARN_ON_ONCE(p == RETRY_TASK))) {
> - /* rq lock may have been dropped, clocks invalidated */
> - core_clock_updated = false;
> - if (!(rq->clock_update_flags & RQCF_UPDATED))
> - update_rq_clock(rq);
> + WARN_ON_ONCE(p == RETRY_TASK)))
> goto restart;
> - }
Thanks.
--
tejun
next prev parent reply other threads:[~2026-09-02 5:38 UTC|newest]
Thread overview: 13+ 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-09-25 14:33 ` Peter Zijlstra
2026-08-28 10:17 ` [PATCH 2/7] sched/core: Simplify/fix time updates Peter Zijlstra
2026-09-02 5:38 ` Tejun Heo [this message]
2026-09-02 14:32 ` Peter Zijlstra
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=ape2abNdAgRCfEtg@slm.duckdns.org \
--to=tj@kernel.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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.