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: "Shubhang Kaushik (Ampere)" <sh@gentwo.org>,
	Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	Shubhang Kaushik <shubhang@os.amperecomputing.com>,
	Christoph Lameter <cl@gentwo.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/fair: Restart hrtick after same-task repicks
Date: Fri, 11 Sep 2026 15:59:51 +0200	[thread overview]
Message-ID: <20260911135951.GG1837346@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKfTPtD_aJeAh1biW6gKCLK6BnYcNtbz-FJvxUzZ1tD3V=43mw@mail.gmail.com>

On Fri, Sep 11, 2026 at 02:36:41PM +0200, Vincent Guittot wrote:

> > @@ -15293,11 +15297,12 @@ static void set_next_task_fair(struct rq *rq, struct task_struct *p, bool first)
> >
> >         WARN_ON_ONCE(se->sched_delayed);
> >
> > -       if (hrtick_enabled_fair(rq))
> > -               hrtick_start_fair(rq, p);
> > -
> >         update_misfit_status(p, rq);
> >         sched_fair_update_stop_tick(rq, p);
> > +
> > +repick:
> > +       if (hrtick_enabled_fair(rq))
> > +               hrtick_start_fair(rq, p);
> 
> While at it, you might want to replace:
> vdelta = se->deadline - se->vruntime;
> by
> vdelta = se->vprot - se->vruntime;
> in hrtick_start_fair()

That should be a separate patch.

> 
> >  }
> >
> >  void init_cfs_rq(struct cfs_rq *cfs_rq)

But that made me thing; do we want something like so folded in here?

Since we got picked again, we should set vprot again, no?

---
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -15279,11 +15279,8 @@ static void set_next_task_fair(struct rq
 	se = &p->se;
 	cfs_rq->curr = se;
 
-	if (on_rq) {
+	if (on_rq)
 		reweight_eevdf(cfs_rq, se, weight, se->on_rq);
-		if (first)
-			set_protect_slice(cfs_rq, se);
-	}
 
 	if (task_on_rq_queued(p)) {
 		/*
@@ -15301,6 +15298,9 @@ static void set_next_task_fair(struct rq
 	sched_fair_update_stop_tick(rq, p);
 
 repick:
+	if (on_rq)
+		set_protect_slice(cfs_rq, se);
+
 	if (hrtick_enabled_fair(rq))
 		hrtick_start_fair(rq, p);
 }

  reply	other threads:[~2026-09-11 14:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 21:23 Shubhang Kaushik (Ampere)
2026-08-26  1:13 ` Shubhang
2026-08-26  4:00 ` Zhan Xusheng
2026-09-10 21:14   ` Shubhang
2026-09-11 11:20 ` Peter Zijlstra
2026-09-11 12:36   ` Vincent Guittot
2026-09-11 13:59     ` Peter Zijlstra [this message]
2026-09-11 14:09       ` Vincent Guittot
2026-09-11 18:56   ` Shubhang

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=20260911135951.GG1837346@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bsegall@google.com \
    --cc=cl@gentwo.org \
    --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@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=sh@gentwo.org \
    --cc=shubhang@os.amperecomputing.com \
    --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®