Re: [PATCH v2 04/12] sched/core: Make __update_rq_clock() skip updates on UPDATED

From: Peter Zijlstra

Date: Wed Nov 11 2026 - 05:30:09 EST


On Tue, Nov 10, 2026 at 03:11:28PM -1000, Tejun Heo wrote:
> Hello, Peter.
>
> On Sat, Nov 07, 2026 at 12:59:17PM +0100, Peter Zijlstra wrote:
> > static void __update_rq_clock(struct rq *rq)
> > {
> > + bool update;
> > +
> > lockdep_assert_rq_held(rq);
> >
> > + update = !(rq->clock_update_flags & RQCF_NOP_MASK);
> > rq->clock_update_flags |= RQCF_UPDATED;
> >
> > - if (!(rq->clock_update_flags & RQCF_ACT_SKIP)) {
> > + if (update) {
>
> RQCF_UPDATED is cleared only by rq_pin_lock() and
> double_rq_clock_clear_update(), so a path which takes the rq lock with
> raw_spin_rq_lock() inherits it from the previous holder and its
> update_rq_clock() is now silently skipped.

Let me look at that specific case.

> Previously, you said to clear on unlock. Why not do that? That'd be less
> confusing overall.

Yes, that's what I tried, but it doesn't work for core-sched. What
happens is that SMT0 and SMT1 interleave and things go to hell, patch 6
has that picture.

That is, we can still clear on unlock too, but clear on unlock alone
isn't sufficient :/

Patch 6 even has the clear on unlock, but commented out.