Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:pseudo_lock_measure_cycles - Trigger latency measure to pseudo-locked region* The measurement of latency to access a pseudo-locked region should be* done from a cpu that is associated with that pseudo-locked region

Proto:static int pseudo_lock_measure_cycles(struct rdtgroup *rdtgrp, int sel)

Type:int

Parameter:

TypeParameterName
struct rdtgroup *rdtgrp
intsel
1153  plr = plr
1156  ret = -1
1158  cpus_read_lock()
1159  mutex_lock( & Mutex to protect rdtgroup access. )
1161  If flags & dtgroup.flags Then
1162  ret = -ENODEV
1163  Go to out
1166  If Not d Then
1167  ret = -ENODEV
1168  Go to out
1171  thread_done = 0
1172  cpu = Uniprocessor. Assume all masks are "1".
1173  If Not cpu_online(cpu) Then
1174  ret = -ENODEV
1175  Go to out
1178  cpu = cpu
1180  If sel == 1 Then thread = kthread_create_on_node(measure_cycles_lat_fn - Measure cycle latency to read pseudo-locked memory*@_plr: pseudo-lock region to measure* There is no deterministic way to test if a memory region is cached. One* way is to measure how long it takes to read the memory, the speed of, plr, cpu_to_node(cpu), "pseudo_lock_measure/%u", cpu)
1185  Else if sel == 2 Then thread = kthread_create_on_node(measure_l2_residency, plr, cpu_to_node(cpu), "pseudo_lock_measure/%u", cpu)
1190  Else if sel == 3 Then thread = kthread_create_on_node(measure_l3_residency, plr, cpu_to_node(cpu), "pseudo_lock_measure/%u", cpu)
1195  Else Go to out
1198  If IS_ERR(thread) Then
1199  ret = PTR_ERR(thread)
1200  Go to out
1202  kthread_bind(thread, cpu)
1203  wake_up_process(thread)
1205  ret = wait_event_interruptible - sleep until a condition gets true*@wq_head: the waitqueue to wait on*@condition: a C expression for the event to wait for* The process is put to sleep (TASK_INTERRUPTIBLE) until the(lock_thread_wq, thread_done == 1)
1207  If ret < 0 Then Go to out
1210  ret = 0
1212  out :
1213  mutex_unlock( & Mutex to protect rdtgroup access. )
1214  cpus_read_unlock()
1215  Return ret
Caller
NameDescribe
pseudo_lock_measure_trigger