danielealbano / cachegrand

cachegrand - a modern data ingestion, processing and serving platform built for today's hardware
BSD 3-Clause "New" or "Revised" License
975 stars 34 forks source link

Bug intrinsic max freq wrong registry #385

Closed danielealbano closed 1 year ago

danielealbano commented 1 year ago

This PR fixes the intrinsics max frequency calculation, on modern Intel CPUs cachegrand tries to utilize the CPUID level 0x16 to read the base frequency, expressed in MHz, instead of trying to calculate it.

This issue wasn't affecting AMD CPUs as they don't expose that CPUID level.

This bug was EXTREMELY serious as was messing up the internal clock handling of cachegrand on, basically, all the recent Intel CPUs causing random crashes and malfuctions, although there are tests for this as they run on the Github runners which emulate the TSC and the CPUIDs the issue was never caught.