Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8255799

AArch64: CPU_A53MAC feature may be set incorrectly

XMLWordPrintable

    • b24
    • aarch64

      The number of cores reported in /proc/cpuinfo was used to decide CPU_A53MAC feature [1].

      As clarified by [~ngasson] in [6]:

      > It's a work around for very old arm64 kernels that only reported a single CPU in /proc/cpuinfo on multi-core systems where you may have a mix of different CPU types (i.e. mixed A53/A57 where the A57 is reported in cpuinfo).
      > The patch to list all CPUs in /proc/cpuinfo was backported to at least the 3.10 series. [7] I really doubt there's anyone running latest OpenJDK on a A53 with such an old kernel.

      But after the change [2], os::processor_count was used instead. As reported in JDK-8255716, processor_count is initialized by [3] and it does not always equal to the number of CPU lines in /proc/cpuinfo, e.g. glibc counts only online cores [4].

      > We should delete lines 184-187 in the current file: this isn't working as intended since the switch to os::processor_count() and as discussed the ancient kernel versions where this was necessary should no longer be in use.[7]

      [1] http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/6e2422a230fd#l6.45
      [2] https://github.com/openjdk/jdk/commit/ec9bee68#diff-a87e260510f34ca7d9b0feb089ad982be8268c5c8aa5a71221f6738b051ea488R187
      [3] https://github.com/openjdk/jdk/blob/master/src/hotspot/os/linux/os_linux.cpp#L364
      [4] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/getsysstats.c;h=6d4c9c06e8a5de1b97da448909aa0874df5f6c88;hb=6d4c9c06e8a5de1b97da448909aa0874df5f6c88#l113
      [5] https://github.com/openjdk/jdk/blob/f279ddfa06392f8ea14224e478a00bad33b84e7a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp#L447
      [6] https://github.com/openjdk/jdk/pull/1039#discussion_r517171147
      [7] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20150209083040.217202212@linuxfoundation.org/
      [8]https://github.com/openjdk/jdk/pull/1039#issuecomment-722073042

            akozlov Anton Kozlov
            akozlov Anton Kozlov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: