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:02
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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

Proto:static int measure_cycles_lat_fn(void *_plr)

Type:int

Parameter:

TypeParameterName
void *_plr
869  plr = _plr
874  local_irq_disable()
878  wrmsr(MSR_MISC_FEATURE_CONTROL, The bits needed to disable hardware prefetching varies based on the* platform. During initialization we will discover which bits to use., 0x0)
879  mem_r = READ_ONCE(kmem)
884  start = dtsc_ordered() - read the current TSC in program order* rdtsc_ordered() returns the result of RDTSC as a 64-bit integer.* It is ordered like a load to a global in-memory counter. It should* be impossible to observe non-monotonic rdtsc_unordered() behavior
885  When i < size cycle
886  start = dtsc_ordered() - read the current TSC in program order* rdtsc_ordered() returns the result of RDTSC as a 64-bit integer.* It is ordered like a load to a global in-memory counter. It should* be impossible to observe non-monotonic rdtsc_unordered() behavior
887  asm volatile
891  end = dtsc_ordered() - read the current TSC in program order* rdtsc_ordered() returns the result of RDTSC as a 64-bit integer.* It is ordered like a load to a global in-memory counter. It should* be impossible to observe non-monotonic rdtsc_unordered() behavior
892  trace_pseudo_lock_mem_latency((u32)(end - start))
894  wrmsr(MSR_MISC_FEATURE_CONTROL, 0x0, 0x0)
895  The local_irq_*() APIs are equal to the raw_local_irq*()* if !TRACE_IRQFLAGS.()
896  thread_done = 1
897  wake_up_interruptible( & lock_thread_wq)
898  Return 0