[Resend,1/1] sched: make cpu_util_cfs formally visible
Commit Message
From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
As RT, DL, IRQ time could be deemed as lost time of CFS's task, some
timing value(eg. algorithm's cost which can't disable preemption)
want to know the distribution of how these timing spread approximately
by using utilization account value (nivcsw is not enough
sometimes), OR evaluate how heavily the preemption is. However,
cpu_util_cfs is not formally visible as not in include/sched.h.
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
Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
---
include/linux/sched.h | 1 +
kernel/sched/sched.h | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
@@ -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
@@ -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)