public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Juri Lelli <juri.lelli@redhat.com>
Cc: Kuyo Chang <kuyo.chang@mediatek.com>,
	Ingo Molnar <mingo@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	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>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	jstultz <jstultz@google.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH 1/1] sched/deadline: Fix fair_server runtime calculation formula
Date: Tue, 17 Jun 2025 16:14:37 +0200	[thread overview]
Message-ID: <20250617141437.GW1613376@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <aFFgi_9yxLN-auBE@jlelli-thinkpadt14gen4.remote.csb>

On Tue, Jun 17, 2025 at 02:33:15PM +0200, Juri Lelli wrote:
> On 17/06/25 10:55, Peter Zijlstra wrote:
> > On Sat, Jun 14, 2025 at 10:04:55AM +0800, Kuyo Chang wrote:
> > > From: kuyo chang <kuyo.chang@mediatek.com>
> > > 
> > > [Symptom]
> > > The calculation formula for fair_server runtime is based on
> > > Frequency/CPU scale-invariance.
> > > This will cause excessive RT latency (expect absolute time).
> > > 
> > > [Analysis]
> > > Consider the following case under a Big.LITTLE architecture:
> > > 
> > > Assume the runtime is : 50,000,000 ns, and FIE/CIE as below
> > > FIE: 100
> > > CIE:50
> > > First by FIE, the runtime is scaled to 50,000,000 * 100 >> 10 = 4,882,812
> > > Then by CIE, it is further scaled to 4,882,812 * 50 >> 10 = 238,418.
> > 
> > What's this FIE/CIE stuff? Is that some ARM lingo?
> > 
> > 
> > > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> > > index ad45a8fea245..8bfa846cf0dc 100644
> > > --- a/kernel/sched/deadline.c
> > > +++ b/kernel/sched/deadline.c
> > > @@ -1504,7 +1504,10 @@ static void update_curr_dl_se(struct rq *rq, struct sched_dl_entity *dl_se, s64
> > >  	if (dl_entity_is_special(dl_se))
> > >  		return;
> > >  
> > > -	scaled_delta_exec = dl_scaled_delta_exec(rq, dl_se, delta_exec);
> > > +	if (dl_se == &rq->fair_server)
> > > +		scaled_delta_exec = delta_exec;
> > > +	else
> > > +		scaled_delta_exec = dl_scaled_delta_exec(rq, dl_se, delta_exec);
> > 
> > Juri, the point it a bit moot atm, but is this something specific to the
> > fair_server in particular, or all servers?
> 
> I believe for other servers (i.e., rt-server work from Yuri and Luca) it
> might be useful to have it configurable somehow. I actually had a recent
> discussion about this concerning single task entities (traditional
> deadline servers) for which as well there might be cases where one might
> want not to scale considering frequency and capacity.
> 
> > Because if this is something all servers require then the above is
> > ofcourse wrong.
> 
> To me it looks like we want this (no scaling) for fair_server (and
> possibly scx_server?) as for them we are only looking into a 'fixed
> time' type of isolation. Full fledged servers (hierarchical scheduling)
> maybe have it configurable, or enabled by default as a start (as we have
> it today).

Right. Then we should write the above like:

	scaled_delta_exec = delta_exec;
	if (!dl_se->dl_server)
		scaled_delta_exec = dl_scaled_delta_exec(rq, dl_se, delta_exec);

and let any later server users add bits on if they want more options.


  reply	other threads:[~2025-06-17 15:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-14  2:04 [PATCH 1/1] sched/deadline: Fix fair_server runtime calculation formula Kuyo Chang
2025-06-14  2:35 ` John Stultz
2025-06-16 14:03 ` Juri Lelli
2025-06-17  8:55 ` Peter Zijlstra
2025-06-17 12:33   ` Juri Lelli
2025-06-17 14:14     ` Peter Zijlstra [this message]
2025-06-17 14:23       ` Juri Lelli
2025-06-17 14:41         ` Kuyo Chang (張建文)

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=20250617141437.GW1613376@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=jstultz@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=kuyo.chang@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --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