函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:throttle_active_work

函数原型:static void __maybe_unused throttle_active_work(struct work_struct *work)

返回类型:void

参数:

类型参数名称
struct work_struct *work
240  state等于container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(to_delayed_work(work), struct_thermal_state, therm_work)
242  this_cpu等于当前cpu ID()
243  now等于get_jiffies_64()
247  get_therm_status(level, & hot, & temp)
249  如果非hottemp大于baseline_temp
250  如果rate_control_active打印信息("CPU%d: %s temperature/speed normal (total events = %lu)\n", this_cpu, level == CORE_LEVEL ? "Core" : "Package", count)
256  rate_control_active = false
257  返回
260  如果time_before64(now, next_check)且rate_control_active则转到:re_arm
264  next_check等于nowHow long to wait between reporting thermal events
266  如果count不等于last_count
268  last_count等于count
269  average等于0
270  sample_count等于0
271  sample_index等于0
274  temp_samples[sample_index]等于temp
275  sample_count自加
276  sample_index等于sample_index加1的和取模ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(temp_samples)
277  如果sample_count小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(temp_samples)则转到:re_arm
280  avg等于0
281 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(temp_samples)循环avg加等于temp_samples[i]
284  avg除等于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(temp_samples)
286  如果average大于avg
287  打印警告信息("CPU%d: %s temperature is above threshold, cpu clock is throttled (total events = %lu)\n", this_cpu, level == CORE_LEVEL ? "Core" : "Package", count)
291  rate_control_active = true
294  average等于avg
296  re_arm :
297  clear_therm_status_log(level)
298  schedule_delayed_work_on - queue work in global workqueue on CPU after delay*@cpu: cpu to use*@dwork: job to be done*@delay: number of jiffies to wait* After waiting for a given time this puts a job in the kernel-global* workqueue on the specified CPU.