[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABk29Nt5pcJpbx7mKUfqbf+yahBw3uz50QpBvOm7u3B6uA+AuA@mail.gmail.com>
Date: Mon, 11 Oct 2021 17:14:29 -0700
From: Josh Don <joshdon@...gle.com>
To: Tao Zhou <tao.zhou@...ux.dev>
Cc: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Joel Fernandes <joel@...lfernandes.org>,
Vineeth Pillai <vineethrp@...il.com>,
Hao Luo <haoluo@...gle.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] sched/core: forced idle accounting
On Sat, Oct 9, 2021 at 11:11 AM Tao Zhou <tao.zhou@...ux.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
Powered by blists - more mailing lists