Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\mce\therm_throt.c Create Date:2022-07-28 08:04:12
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:throttle_active_work

Proto:static void __maybe_unused throttle_active_work(struct work_struct *work)

Type:void

Parameter:

TypeParameterName
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 = smp_processor_id()
243  now = get_jiffies_64()
247  get_therm_status(level, & hot, & temp)
249  If Not hot && temp > baseline_temp Then
250  If rate_control_active Then pr_info("CPU%d: %s temperature/speed normal (total events = %lu)\n", this_cpu, level == CORE_LEVEL ? "Core" : "Package", count)
256  rate_control_active = false
257  Return
260  If time_before64(now, next_check) && rate_control_active Then Go to re_arm
264  next_check = now + How long to wait between reporting thermal events
266  If count != last_count Then
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  If sample_count < ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(temp_samples) Then Go to re_arm
280  avg = 0
281  When i < ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(temp_samples) cycle avg += temp_samples[i]
284  avg /= ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(temp_samples)
286  If average > avg Then
287  pr_warn("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.