函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:apm_cpu_idle

函数原型:static int apm_cpu_idle(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index)

返回类型:int

参数:

类型参数名称
struct cpuidle_device *dev
struct cpuidle_driver *drv
intindex
908  apm_idle_done等于0
909  jiffies_since_last_check等于jiffieslast_jiffies
912  recalc :
913  task_cputime(当前进程, & utime, & stime)
914  如果jiffies_since_last_check大于If no process has really been interested in* the CPU for some time, we want to call BIOS* power management - we probably want* to conserve power.
915  use_apm_idle等于0
916  否则如果jiffies_since_last_check大于idle_period
919  idle_percentage等于nsecs_to_jiffies(stime - last_stime)
920  idle_percentage乘等于100
921  idle_percentage除等于jiffies_since_last_check
922  use_apm_idle等于idle_percentage大于idle_threshold
923  如果forbid_idleuse_apm_idle等于0
927  last_jiffies等于jiffies
928  last_stime等于stime
930  bucket等于IDLE_LEAKY_MAX
932  当非need_resched()循环
933  如果use_apm_idle
936  t等于jiffies
939  apm_idle_done等于1
940  如果t不等于jiffies
941  如果bucket
942  bucket等于IDLE_LEAKY_MAX
943  继续下一循环
945  否则如果bucket
946  bucket自减
947  继续下一循环
949  退出
951  apm_idle_done等于1
952  退出
953  默认
954  退出
957  We use this if we don't have any better idle routine..
958  禁止中断()
959  jiffies_since_last_check等于jiffieslast_jiffies
960  如果jiffies_since_last_check大于idle_period则转到:recalc
964  如果apm_idle_doneapm_do_busy - inform the BIOS the CPU is busy* Request that the BIOS brings the CPU back to full performance.
967  返回:index