lkml.org 
[lkml]   [2021]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] sched/core: forced idle accounting
On Sat, Oct 9, 2021 at 11:11 AM Tao Zhou <tao.zhou@linux.dev> wrote:
[snip]
> > + smt_count = cpumask_weight(smt_mask);
> > + if (smt_count > 2) {
> > + unsigned int nr_forced_idle = 0, nr_running = 0;
> > +
> > + for_each_cpu(i, smt_mask) {
> > + rq_i = cpu_rq(i);
> > + p = rq_i->core_pick ?: rq_i->curr;
> > +
> > + if (p != rq_i->idle)
> > + nr_running++;
> > + else if (rq_i->nr_running)
> > + nr_forced_idle++;
> > + }
> > +
> > + if (WARN_ON_ONCE(!nr_running)) {
> > + /* can't be forced idle without a running task */
> > + } else {
> > + delta *= nr_forced_idle;
> > + delta /= nr_running;
> > + }
>
> Is it possible to use (smt_count - core_occupation) / core_occupation
> to evaluate this delta ?

Good point, we can use the pre-computed info here. This will help
simplify this logic.

Thanks,
Josh

\
 
 \ /
  Last update: 2021-10-12 02:15    [W:0.094 / U:3.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site