Re: [PATCH v2] x86/centaur: Mark TSC invariant

From: Thomas Gleixner
Date: Thu Dec 28 2017 - 06:12:42 EST


On Mon, 27 Nov 2017, TimGuo wrote:

> During the FIO benchmark for block device, we found there are lots of clocksource
> access. TSC access latency is much lower than HPET. Use TSC as clocksource can improve
> the FIO benchmark result.
>
>
> changes from v1 to v2:
> ---------------------
> Adjust the subject and description of this patch according to tglx's suggestion.

Well, the subject makes sense. The changelog not so much.

It's completely irrelevant whether you run a FIO benchmark or something
different.

What's relevant is that the CPU has a constant frequency TSC and that TSC
does not stop in C-States. But because the flags are not set for that CPU
the TSC is treated as non constant frequency and assumed to stop in
C-States, which makes it an unreliable and unusable clock source.

Setting those flags tells the kernel that the TSC is usable, so it will
select it over HPET. The effect of this is that reading time stamps (from
kernel or user space) will be faster and more efficient.

Thanks,

tglx