关于dpdk timer跨越CPU core调度的准确性问题
首先dpdk的timer接口里边使用 cpu cycle来比较时间。根据之前的内容
[dpdk] dpdk --lcores参数
当一个EAL thread映射在多个processor上的时候,cpu cycle有可能在不同的CPU core上面获得,
又因为cpu cycle是使用rdtsc指令获取的,这样会造成拿到的cpu cycle不准的问题。
首先,调查一下 rdtsc 指令:
https://stackoverflow.com/questions/3388134/rdtsc-accuracy-across-cpu-cores?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
Invariant TSC
X86_FEATURE_CONSTANT_TSC
+ X86_FEATURE_NONSTOP_TSC
"16.11.1 Invariant TSC The time stamp counter in newer processors may support an enhancement, referred to as invariant TSC. Processor's support for invariant TSC is indicated by CPUID.80000007H:EDX[8]. The invariant TSC will run at a