函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__set_cyc2ns_scale

函数原型:static void __set_cyc2ns_scale(unsigned long khz, int cpu, unsigned long long tsc_now)

返回类型:void

参数:

类型参数名称
unsigned longkhz
intcpu
unsigned long longtsc_now
129  ns_now等于Accelerators for sched_clock()* convert from cycles(64bits) => nanoseconds (64bits)* basic equation:* ns = cycles / (freq / ns_per_sec)* ns = cycles * (ns_per_sec / freq)* ns = cycles * (10^9 / (cpu_khz * 10^3))* ns = cycles * (10^6 / cpu_khz)
136  clocks_calc_mult_shift( & cyc2ns_mul, & cyc2ns_shift, khz, NSEC_PER_MSEC, 0)
145  如果cyc2ns_shift恒等于32则
146  cyc2ns_shift等于31
147  cyc2ns_mul右移等于1位
150  cyc2ns_offset等于ns_nowmul_u64_u32_shr(tsc_now, cyc2ns_mul, cyc2ns_shift)
153  c2n等于per_cpu_ptr( & cyc2ns, cpu)
155  aw_write_seqcount_latch - redirect readers to even/odd copy*@s: pointer to seqcount_t* The latch technique is a multiversion concurrency control method that allows* queries during non-atomic modifications. If you can guarantee queries never
156  0 + 2*16 = 32 [0]等于data
157  aw_write_seqcount_latch - redirect readers to even/odd copy*@s: pointer to seqcount_t* The latch technique is a multiversion concurrency control method that allows* queries during non-atomic modifications. If you can guarantee queries never
158  0 + 2*16 = 32 [1]等于data
调用者
名称描述
set_cyc2ns_scale
cyc2ns_init_boot_cpuInitialize cyc2ns for boot cpu