lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 13 Feb 2024 08:45:56 +0100
From: Vincent Guittot <vincent.guittot@...aro.org>
To: "zhaoyang.huang" <zhaoyang.huang@...soc.com>
Cc: Mel Gorman <mgorman@...hsingularity.net>, Peter Zijlstra <peterz@...radead.org>, 
	Ingo Molnar <mingo@...hat.com>, Juri Lelli <juri.lelli@...hat.com>, linux-kernel@...r.kernel.org, 
	Zhaoyang Huang <huangzhaoyang@...il.com>, steve.kang@...soc.com
Subject: Re: [PATCH] sched: make cpu_util_cfs visible

On Sun, 11 Feb 2024 at 08:50, zhaoyang.huang <zhaoyang.huang@...soc.com> wrote:
>
> From: Zhaoyang Huang <zhaoyang.huang@...soc.com>
>
> As RT, DL, IRQ time could be deemed as lost time of CFS's task, some
> timing value want to know the distribution of how these spread
> approximately by using utilization account value (nivcsw is not enough
> sometimes), wheras, cpu_util_cfs is not visible out side of
> kernel/sched, This commit would like to make it be visible.

We expect a user of this to be sent as part of the patchset

>
> eg.
> Effective part of A = Total_time * cpu_util_cfs / sched_cpu_util
>
> Task's Timing value A
> Timing start
> |
> |
> preempted by RT, DL or IRQ
> |\
> | This period time is nonvoluntary CPU give up, need to know how long
> |/
> sched in again
> |
> |
> |
> Timing end

You have to use *_avg with care if you want to get such figures
because they do not only reflect the last task activation but an
average of the past dozens of ms so you can easily get wrong figures.


>
> Signed-off-by: Zhaoyang Huang <zhaoyang.huang@...soc.com>
> ---
>  include/linux/sched.h | 1 +
>  kernel/sched/sched.h  | 1 -
>  2 files changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index 77f01ac385f7..56953626526f 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -2318,6 +2318,7 @@ static inline bool owner_on_cpu(struct task_struct *owner)
>
>  /* Returns effective CPU energy utilization, as seen by the scheduler */
>  unsigned long sched_cpu_util(int cpu);
> +unsigned long cpu_util_cfs(int cpu);
>  #endif /* CONFIG_SMP */
>
>  #ifdef CONFIG_RSEQ
> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> index 04846272409c..46110409e0f3 100644
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h
> @@ -3027,7 +3027,6 @@ static inline unsigned long cpu_util_dl(struct rq *rq)
>  }
>
>
> -extern unsigned long cpu_util_cfs(int cpu);
>  extern unsigned long cpu_util_cfs_boost(int cpu);
>
>  static inline unsigned long cpu_util_rt(struct rq *rq)
> --
> 2.25.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ