RFR: 8283199: Linux os::cpu_microcode_revision() stalls cold startup [v3]

Aleksey Shipilev shade at openjdk.java.net
Mon Mar 21 13:38:37 UTC 2022


On Mon, 21 Mar 2022 12:55:19 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> Do you know _why_ access to /proc is slower than to /sys/devices? Is it all /proc accesses or just /proc/cpuinfo?

I suspect that's because we generate the entirety of `/proc/cpuinfo` on read, which includes doing lots of string printing, getting the CPU frequency (which, AFAICS, includes IPI). I have not explored this part deeply, though.


$ perf record -F max -g cat /proc/cpuinfo
$ perf report
...
-   93.92%     0.00%  cat      [kernel.kallsyms]  [k] entry_SYSCALL_64_after_hwframe                                                                         
   - do_syscall_64
      + 56.91% __x64_sys_write
      - 29.19% __x64_sys_read
           ksys_read
           vfs_read
           __vfs_read
           proc_reg_read
         - seq_read
            - 28.63% show_cpuinfo
               - 18.40% seq_printf
                  - seq_vprintf
                     - 13.17% vsnprintf
                        + 6.90% format_decode
                        + 3.19% string
                          0.84% number
                       2.47% memcpy
                       0.56% format_decode
               - 4.42% aperfmperf_get_khz
                  - aperfmperf_snapshot_cpu
                     - smp_call_function_single
                        - generic_exec_single
                          native_send_call_func_single_ipi
                          default_send_IPI_single_phys
                          __default_send_IPI_dest_field
              0.56% seq_printf

-------------

PR: https://git.openjdk.java.net/jdk/pull/7825


More information about the hotspot-runtime-dev mailing list