函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Perform (stime * rtime) / total, but avoid multiplication overflow by* losing precision when the numbers are big.

函数原型:static u64 scale_stime(u64 stime, u64 rtime, u64 total)

返回类型:u64

参数:

类型参数名称
u64stime
u64rtime
u64total
533  循环
535  如果stime大于rtimeswap - swap values of @a and @b*@a: first value*@b: second value(rtime, stime)
539  如果total右移32位则转到:drop_precision
543  如果非rtime右移32位的值则退出
547  如果stime右移31位则转到:drop_precision
551  stime左移等于1位
552  rtime右移等于1位
553  继续下一循环
555  drop_precision :
557  rtime右移等于1位
558  total右移等于1位
565  scaled等于div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
566  返回:scaled
调用者
名称描述
cputime_adjustAdjust tick based cputime random precision against scheduler runtime* accounting