02-08-2019 05:32 AM
The ThinkPad A485 BIOS seems to be breaking TSC synchronization:
Basically, CPU0 has a TSC offset of about -1600ms from all the other CPUs. Since AMD CPUs do not support MSR_IA32_TSC_ADJUST, the Linux kernel isn't able to compensate for the delta and falls back to using clocksource=hpet (which is about 100x slower to read compared to the TSC). This will cause some serious performance problems for anything that reads a clocksource via clock_gettime/gettimeofday/ftime/etc.
Are there any Lenovo firmware engineers reading this forum?
05-22-2019 10:44 PM
05-22-2019 11:36 PM
Yeah, I didn't have a lot of hope about it, but it's what Lenovo's support team actually recommended. (I know, right?!)
In any case, Lenovo is now aware of the issue -- I got ahold of some senior folks on the ThinkPad teams through other channels. After some explanation they confirmed that they could reproduce the issue and would work on a fix. Unfortunately since it's a firmware or microcode bug, it may be a while before we see a fix make it through QA.
05-22-2019 11:50 PM
By the way, if you want a temporary fix that allows you to use the TSC as your clocksource, you can apply this patch and build your own kernel (or if you're on Arch you could add my repo and install "linux-hsw", I keep the kernel following current releases around once or twice per week):
It's not a great fix because the lack of IA32_TSC_ADJUST means we have to try several times to get close to the right values for the TSCs, but I've been running with this patch for several months now on my A485 and haven't had any significant trouble with it yet. It does get slightly confused on suspend/resume (the timestamp prefixing each line in dmesg goes crazy) but I haven't seen any bad userspace-level issues.