函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\fair.c Create Date:2022-07-27 10:38:44
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:分配给进程的运行时间

函数原型:static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)

返回类型:u64

参数:

类型参数名称
struct cfs_rq *cfs_rq
struct sched_entity *se
693  slice等于The idea is to set a period in which each task runs once.* When there are too many tasks (sched_nr_latency) we have to stretch* this period because otherwise the slices get too small.* p = (nr <= nl) ? l : l*nr/nl
699  cfs_rq等于cfs_rq_of(se)
700  load等于load
702  如果此条件成立可能性小(为编译器优化)(!on_rq)则
703  lw等于load
705  update_load_add( & lw, weight)
706  load等于lw
708  slice等于delta_exec * weight / lw.weight* OR* (delta_exec * (weight * lw->inv_weight)) >> WMULT_SHIFT* Either weight := NICE_0_LOAD and lw \e sched_prio_to_wmult[], in which case* we're guaranteed shift stays positive because inv_weight is guaranteed to
710  返回:slice
调用者
名称描述
sched_vsliceWe calculate the vruntime slice of a to-be-inserted task.* vs = s/w
check_preempt_tick检查当前进程是否需要被抢占
get_rr_interval_fair