Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\cputime.c Create Date:2022-07-28 09:37:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Adjust tick based cputime random precision against scheduler runtime* accounting

Proto:void cputime_adjust(struct task_cputime *curr, struct prev_cputime *prev, u64 *ut, u64 *st)

Type:void

Parameter:

TypeParameterName
struct task_cputime *curr
struct prev_cputime *prev
u64 *ut
u64 *st
596  raw_spin_lock_irqsave( & lock, flags)
597  rtime = sum_exec_runtime
607  If stime + utime >= rtime Then Go to out
610  stime = stime
611  utime = utime
618  If stime == 0 Then
619  utime = rtime
620  Go to update
623  If utime == 0 Then
624  stime = rtime
625  Go to update
628  stime = Perform (stime * rtime) / total, but avoid multiplication overflow by* losing precision when the numbers are big.
630  update :
640  If stime < stime Then stime = stime
642  utime = rtime - stime
648  If utime < utime Then
649  utime = utime
650  stime = rtime - utime
653  stime = stime
654  utime = utime
655  out :
656  ut = utime
657  st = stime
658  raw_spin_unlock_irqrestore( & lock, flags)
Caller
NameDescribe
task_cputime_adjusted
thread_group_cputime_adjusted
cgroup_base_stat_cputime_show