JDK-8056124 : Hotspot should use PICL interface to get cacheline size on SPARC
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 7,8u40,9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: sparc
  • Submitted: 2014-08-26
  • Updated: 2017-08-10
  • Resolved: 2014-09-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
7u80Fixed 8u40Fixed 9 b32Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Currently the cache line size on SPARC is hardcoded into VM:

 static intx prefetch_data_size() {
    return is_T4() && !is_T7() ? 32 : 64; // default prefetch block size on sparc

 static bool is_T4() { return is_T_family(_features) && has_cbcond(); }
 static bool is_T7() { return is_T_family(_features) && has_sparc5_instr(); }

Where is_T_family() relies on data from kstat library:

} else if (strstr(impl, "SPARC-T") != NULL) {
  features |= T_family_m;

Unfortunately in virtual machine kstat may not provide such information (JDK-8035283).

We should use PICL (libpicl.so) interface to get (L2) cache line size on SPARC. I verified that Solaris 10u9, which is jdk7 supported OS, has libpicl.so.

This fix makes the PICL library a requirement on amd64 as well, is this intentional?

The system could have different cpus. We need to check all of them and if they have different cahceline sizes we need to disable UseBlockZeroing and UseBlockCopy code which use BIS instructions.

Attached Greg's C program which uses libpicl to read L2 cache line size