diff mbox

[aarch64-port-dev] Restrict ReservedCodeCache to 128M

Message ID CAEf2cjfr4F3+Urt2UD3mYZPaCORfCyPkFEutxV+NrG_sEXg-PQ@mail.gmail.com
State New
Headers show

Commit Message

Edward Nevill July 8, 2014, 6:05 p.m. UTC
On 8 July 2014 10:43, Andrew Haley <aph@redhat.com> wrote:

> On 07/08/2014 10:35 AM, Edward Nevill wrote:
> > I have chosen to only restrict the default code cache size so it can
> still be overridden with -XX:ReservedCodeCacheSize
>
> Err, this should at least be conditionalized on AARCH64.
>

Yes, sorry.


>
> Couldn't we do it in the back end?
>

I can see no obvious way to do it in the back end.

The code in vm_version_aarch64.cpp where other arch dependant stuff is done
like UseCRC32 is called too late, IE. it is called after
ReservedCodeCacheSize has already been used to initialise the code heap.

Patch below conditionalises on AARCH_ONLY

The alternative would be to set ReservedCodeCacheSize to 25M in c2_globals
instead of 48M so that 5*ReservedCodeCacheSize < 128M. This would mean
however that -XX:-TieredCompilation would only get a heap of 25M.

Which is best?

Ed.

--- CUT HERE ---
# HG changeset patch
# User Edward Nevill edward.nevill@linaro.org
# Date 1404842629 -3600
#      Tue Jul 08 19:03:49 2014 +0100
# Node ID 6c07d806085bdc65a6a99a8e1394d1890a66c6cb
# Parent  5ed1bb528b990f293f6abbef834f7c4bf0dea406
Restrict default ReservedCodeCacheSize to 128M

     Tier3InvokeNotifyFreqLog = 0;
--- CUT HERE ---

Comments

Andrew Haley July 8, 2014, 6:27 p.m. UTC | #1
On 07/08/2014 07:05 PM, Edward Nevill wrote:
> On 8 July 2014 10:43, Andrew Haley <aph@redhat.com> wrote:
> 
>> On 07/08/2014 10:35 AM, Edward Nevill wrote:
>>> I have chosen to only restrict the default code cache size so it can
>> still be overridden with -XX:ReservedCodeCacheSize
>>
>> Err, this should at least be conditionalized on AARCH64.
>>
> 
> Yes, sorry.
> 
> 
>>
>> Couldn't we do it in the back end?
>>
> 
> I can see no obvious way to do it in the back end.
> 
> The code in vm_version_aarch64.cpp where other arch dependant stuff is done
> like UseCRC32 is called too late, IE. it is called after
> ReservedCodeCacheSize has already been used to initialise the code heap.
> 
> Patch below conditionalises on AARCH_ONLY
> 
> The alternative would be to set ReservedCodeCacheSize to 25M in c2_globals
> instead of 48M so that 5*ReservedCodeCacheSize < 128M. This would mean
> however that -XX:-TieredCompilation would only get a heap of 25M.
> 
> Which is best?

This patch is best.  Please add a comment here
// The maximum B/BL offset range on AArch64 is 128MB

TVM,
Andrew.


> --- CUT HERE ---
> # HG changeset patch
> # User Edward Nevill edward.nevill@linaro.org
> # Date 1404842629 -3600
> #      Tue Jul 08 19:03:49 2014 +0100
> # Node ID 6c07d806085bdc65a6a99a8e1394d1890a66c6cb
> # Parent  5ed1bb528b990f293f6abbef834f7c4bf0dea406
> Restrict default ReservedCodeCacheSize to 128M
> 
> diff -r 5ed1bb528b99 -r 6c07d806085b src/share/vm/runtime/arguments.cpp
> --- a/src/share/vm/runtime/arguments.cpp    Tue Jul 08 08:29:51 2014 -0400
> +++ b/src/share/vm/runtime/arguments.cpp    Tue Jul 08 19:03:49 2014 +0100
> @@ -1131,6 +1131,7 @@
>    // Increase the code cache size - tiered compiles a lot more.
>    if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
>      FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 5);
> +    AARCH64_ONLY(FLAG_SET_DEFAULT(ReservedCodeCacheSize,
> MIN2(ReservedCodeCacheSize, 128*M)));
>    }
>    if (!UseInterpreter) { // -Xcomp
>      Tier3InvokeNotifyFreqLog = 0;
> --- CUT HERE ---
>
diff mbox

Patch

diff -r 5ed1bb528b99 -r 6c07d806085b src/share/vm/runtime/arguments.cpp
--- a/src/share/vm/runtime/arguments.cpp    Tue Jul 08 08:29:51 2014 -0400
+++ b/src/share/vm/runtime/arguments.cpp    Tue Jul 08 19:03:49 2014 +0100
@@ -1131,6 +1131,7 @@ 
   // Increase the code cache size - tiered compiles a lot more.
   if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
     FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 5);
+    AARCH64_ONLY(FLAG_SET_DEFAULT(ReservedCodeCacheSize,
MIN2(ReservedCodeCacheSize, 128*M)));
   }
   if (!UseInterpreter) { // -Xcomp