mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: mingo@redhat.com, juri.lelli@redhat.com,
	dietmar.eggemann@arm.com, rostedt@goodmis.org,
	bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
	dhaval@gianis.ca, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/6] sched/fair: Manage lag and run to parity with different slices
Date: Tue, 8 Jul 2025 20:44:36 +0200	[thread overview]
Message-ID: <20250708184436.GA477119@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKfTPtDD0J0NBipE7AsXxUHCSeKb3VR44o1tDc0nGkcDeR70Ew@mail.gmail.com>

On Mon, Jul 07, 2025 at 05:49:05PM +0200, Vincent Guittot wrote:

> > > Patch 5 fixes the case of tasks not being eligible at wakeup or after
> > > migrating  but with a shorter slice. We need to update the duration of the
> > > protection to not exceed the lag.
> >
> > This has issues with non-determinism; specifically,
> > update_protected_slice() will use the current ->vruntime, and as such
> > can unduly push forward the protection window.
> 
> se->vprot = min_vruntime(se->vprot, (se->vruntime +
> calc_delta_fair(quantum, se)));
> 
> the min_vruntime (previously min) with current vprot (previously vlag)
> should prevent pushing forward the protection. We can only reduce
> further the vlag but never increase it

Fair enough.

> > +/*
> > + * Should we still run @se? It is allowed to run until either se->deadline or
> > + * until se->vprot + min_vslice, whichever comes first.
> > + */
> > +static inline bool protect_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)
> >  {
> > +       u64 min_vslice, deadline = se->deadline;
> > +       u64 min_slice = cfs_rq_min_slice(cfs_rq);
> >
> > +       if (min_slice != se->slice) {
> > +               min_vslice = calc_delta_fair(min_slice, se);
> > +               deadline = min_vruntime(se->deadline, se->vprot + min_vslice);
> 
> I didn't go into that direction because protect_slice() is call far
> more often than set_protect_slice() or update_protect_slice()

Right.

> > +       }
> >
> > +       WARN_ON_ONCE(!se->on_rq);
> > +
> > +       return ((s64)(deadline - se->vruntime) > 0);
> >  }

Anyway, I see you posted a new version. Let me go have a look.

      reply	other threads:[~2025-07-08 18:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-04 14:36 Vincent Guittot
2025-07-04 14:36 ` [PATCH v2 1/6] sched/fair: Use protect_slice() instead of direct comparison Vincent Guittot
2025-07-04 14:36 ` [PATCH 2/6] sched/fair: Fix NO_RUN_TO_PARITY case Vincent Guittot
2025-07-04 14:36 ` [PATCH v2 3/6] sched/fair: Remove spurious shorter slice preemption Vincent Guittot
2025-07-05 14:15   ` kernel test robot
2025-07-04 14:36 ` [PATCH v2 4/6] sched/fair: Limit run to parity to the min slice of enqueued entities Vincent Guittot
2025-07-04 14:36 ` [PATCH v2 5/6] sched/fair: Fix entity's lag with run to parity Vincent Guittot
2025-07-04 14:36 ` [PATCH v2 6/6] sched/fair: Always trigger resched at the end of a protected period Vincent Guittot
2025-07-07 14:14 ` [PATCH v2 0/6] sched/fair: Manage lag and run to parity with different slices Peter Zijlstra
2025-07-07 15:49   ` Vincent Guittot
2025-07-08 18:44     ` Peter Zijlstra [this message]

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=20250708184436.GA477119@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bsegall@google.com \
    --cc=dhaval@gianis.ca \
    --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=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

all inboxes | Powered by JetHome®