mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juri Lelli <juri.lelli@redhat.com>
To: Yuri Andriaccio <yurand2000@gmail.com>
Cc: bsegall@google.com, dietmar.eggemann@arm.com,
	linux-kernel@vger.kernel.org, luca.abeni@santannapisa.it,
	mgorman@suse.de, mingo@redhat.com, peterz@infradead.org,
	rostedt@goodmis.org, vincent.guittot@linaro.org,
	vschneid@redhat.com, yuri.andriaccio@santannapisa.it
Subject: Re: [PATCH v2] sched/deadline: Remove fair-servers from real-time task's bandwidth accounting
Date: Tue, 12 Aug 2025 16:18:18 +0200	[thread overview]
Message-ID: <aJtNKvNzkoAlIW9k@jlelli-thinkpadt14gen4.remote.csb> (raw)
In-Reply-To: <20250801160352.4816-1-yurand2000@gmail.com>

Hey,

On 01/08/25 18:03, Yuri Andriaccio wrote:
> Hi,
> 
> thanks for reviewing the patch.
> 
> > > @@ -1688,17 +1690,14 @@ int dl_server_apply_params(struct sched_dl_entity *dl_se, u64 runtime, u64 perio
> > >  
> > >    cpus = dl_bw_cpus(cpu);
> > >    cap = dl_bw_capacity(cpu);
> > > +  max_bw = div64_ul(cap_scale(BW_UNIT - dl_b->bw, cap), (unsigned long)cpus);
> > 
> > fc975cfb3639 ("sched/deadline: Fix dl_server runtime calculation
> > formula") essentially removed cap/freq scaling for dl-servers. Should we
> > rather not scale max_bw here as well?
> 
> Now that I think about it, you are correct. Since the fair-servers' rate is
> fixed (i.e. by default 50ms every second), the bandwidth must be scaled for both
> the CPU and the server, or equally, neither needs scaling for the check in
> question.
> 
> ...
> 
> > > @@ -3149,10 +3138,13 @@ int sched_dl_global_validate(void)
> > >        goto next;
> > >  
> > >      dl_b = dl_bw_of(cpu);
> > > -    cpus = dl_bw_cpus(cpu);
> > > +    cap = dl_bw_capacity(cpu);
> > > +    fair_bw = dl_bw_fair(cpu);
> > >  
> > >      raw_spin_lock_irqsave(&dl_b->lock, flags);
> > > -    if (new_bw * cpus < dl_b->total_bw)
> > > +    if (cap_scale(new_bw, cap) < dl_b->total_bw)
> > > +      ret = -EBUSY;
> > 
> > It's kind of a minor one, but can't we return early at this point already?
> 
> Yes, I suppose so. I'll update the patch to return as soon as the error
> condition is met.
> 
> Additionally, I'll also update some of the checks in the above function to
> reflect the aforementioned fixed rate behaviour for fair-servers.

Don't think you had a chance to send a new version yet, no worries!

But, I just noticed that this seems to regress cpu hotplug. With this
applied, offlining of cpus fails with device or resource busy on my test
system. Can you please double check?

Thanks!
Juri


      reply	other threads:[~2025-08-12 14:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-25 16:44 Yuri Andriaccio
2025-07-25 18:04 ` Matteo Martelli
2025-08-01  7:37 ` Juri Lelli
2025-08-01 16:03   ` Yuri Andriaccio
2025-08-12 14:18     ` Juri Lelli [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=aJtNKvNzkoAlIW9k@jlelli-thinkpadt14gen4.remote.csb \
    --to=juri.lelli@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.abeni@santannapisa.it \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=yurand2000@gmail.com \
    --cc=yuri.andriaccio@santannapisa.it \
    /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®