Re: [PATCH 0/2] Exposing nice CPU usage to userspace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, thank you for reviewing the patch.

On Mon, Aug 26, 2024 at 10:43 AM Michal Koutný <mkoutny@xxxxxxxx> wrote:
> The difference between the two metrics is in cputime.c:
>         index = (task_nice(p) > 0) ? CPUTIME_NICE : CPUTIME_USER;
>
> > Exposing this metric will allow load balancers to correctly probe the
> > niced CPU metric for each workload, and make more informed decisions
> > when directing higher priority tasks.
>
> How would this work? (E.g. if too little nice time -> reduce priority
> of high prio tasks?)

We can find what fraction of the task is being run as a nice process by
dividing the two metrics (nice / user) and determining the fraction of
niceness. When a high prio task comes into the load balancer and must
decide where the task should be delegated to, the balancer can use how much
of the task is nice as one factor in making the decision.

The reverse is also true; host-level information in /proc/stat may indicate that
a high percentage of CPU time is being used by nice processes, giving an
illusion that all tasks within the host are running nice processes,
when in reality,
it is just one task that is using a lot of nice CPU time, and other tasks are
running nonnice tasks. By including cgroup-level nice statistics, we can get
a clearer picture and avoid overloading a host with too many high prio tasks.

Like you suggested, this information can also help in re-prioritizing
the processes, which may help high prio tasks become executed quicker.

Thanks,
Joshua





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux