lkml.org 
[lkml]   [2021]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched/core: forced idle accounting
On Mon, Oct 11, 2021 at 05:12:43PM -0700, Josh Don wrote:

> > > + if (WARN_ON_ONCE(!nr_running)) {
> > > + /* can't be forced idle without a running task */
> > > + } else {
> > > + delta *= nr_forced_idle;
> > > + delta /= nr_running;
> > > + }
> >
> > Now the comment sayeth:
> >
> > > + /*
> > > + * For larger SMT configurations, we need to scale the charged
> > > + * forced idle amount since there can be more than one forced idle
> > > + * sibling and more than one running cookied task.
> > > + */
> >
> > But why?
>
> We scale by the number of cpus actually forced idle, since we don't
> want to falsely over or under charge forced idle time (defined
> strictly as time where we have a runnable task but idle the cpu). The
> more important scaling here though is the division over the number of
> running entities. This is done so that the aggregate amount of forced
> idle over some group of threads makes sense. Ie if we have a cpu with
> SMT8, and a group of 7 threads sharing a cookie, we don't want to
> accrue 7 units of forced idle time per unit time while the 8th SMT is
> forced idle.

So why not simply compute the strict per-cpu force-idle time and let
userspace sort out the rest?

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