TSC is not used for CPUTimeStampCounter on AMD processor

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P4
    • tbd
    • Affects Version/s: 16, 17
    • Component/s: hotspot
    • x86, x86_64

      I ran JVM on Ryzen 3300X, and I got following `jdk.CPUTimeStampCounter` event.

      ```
      jdk.CPUTimeStampCounter {
        startTime = 10:41:14.993
        fastTimeEnabled = false
        fastTimeAutoEnabled = true
        osFrequency = 1000000000
        fastTimeFrequency = 1000000000
      }
      ```

      I confirmed 3300X supports Invariant TSC (so `fastTimeAutoEnabled` is set to `true`), however it does not seem to be used (`fastTimeEnabled` is `false`).

      Frequency is come from brand string from CPUID (e.g. "Intel(R) Core(TM) i3-8145U CPU @ 2.10GHz"). However AMD processor (Ryzen at least) does not have it ("AMD Ryzen 3 3300X 4-Core Processor").
      Fortunately rdtsc_x86.cpp can calculate the frequency like bogomips. We should fallback to it if we cannot get the frequency even if invariant TSC is supported.

            Assignee:
            Yasumasa Suenaga
            Reporter:
            Yasumasa Suenaga
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: