AARCH64: 8064611: Changes to HotSpot shared code

Edward Nevill edward.nevill at linaro.org
Fri Nov 14 10:34:09 UTC 2014


On Thu, 2014-11-13 at 19:10 -0800, Vladimir Kozlov wrote:
> runtime/arguments.cpp
> 
> Is it really 128MB max value for ReservedCodeCacheSize on aarch64? What 
> is default ReservedCodeCacheSize size?

Yes. The limit is imposed by the maximum span of the B/BL instructions. 

In practice we have not found this to be a problem. Overnight testing with Hadoop, Specjbb, SpecJVM, JTreg, jcstress shows it gets nowhere near 128M.

The default value of ReservedCodeCacheSize depends on the arch and C1/C2/Tiered settings

So, for example

aarch64(C1) ReservedCodeCacheSize = 32*M
aarch64(C2) ReservedCodeCacheSize = 48*M
ppc(C2) ReservedCodeCacheSize = 256*M
x86(C1) ReservedCodeCacheSize = 32*M
x86(C2) ReservedCodeCacheSize = 48*M

However, in arguments.cpp it increases ReservedCodeCacheSize if TieredCompilation is enabled in set_tiered_flags.

  // Increase the code cache size - tiered compiles a lot more.
  if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
    FLAG_SET_ERGO(uintx, ReservedCodeCacheSize, ReservedCodeCacheSize * 5);
  }

And hence the reason we had to put the limit of 128M (because 5*48M > 128M, unless we were will to reduce the default ReservedCodeCacheSize in the non tier case to < 128M/5).

> 
> You may need to change next code if you can allocate only 128MB:
> 
> 2547   } else if (ReservedCodeCacheSize > 2*G) {
> 2548     // Code cache size larger than MAXINT is not supported.
> 2549     jio_fprintf(defaultStream::error_stream(),
> 
> I think you need to add new platforms specific flag CodeCacheSizeLimit 
> and use it instead of our hard-coded 2Gb (maxint).

OK. So what you are suggesting is adding CodeCacheSizeLimt as a product_pd to globals.hpp, then adding a define_pd_global to each of globals_aarch64.hpp, globals_x86.hpp, ....? Or something else?

All the best,
Ed.




More information about the hotspot-dev mailing list