RFR (S): 7198334: UseNUMA modifies system parameters on non-NUMA system

Erik Helin erik.x.helin at oracle.com
Mon Oct 29 07:29:22 PDT 2012


Hi everyone,

the webrev can be found at:

http://cr.openjdk.java.net/~jwilhelm/7198334/webrev/

Summary:
The bug existed because the function 'Arguments::parse' changed the 
value of the flags 'UseNUMAInterleaving' and 'MinHeapDeltaBytes' 
depending on the value of the flag 'UseNUMA'.

The problem was that the function 'os::init_2' checks if NUMA is 
supported on the system, and if it is not supported, sets 'UseNUMA' to 
'false'.

Since 'Arguments::parse' is called before 'os::init_2' in the function 
'Threads::create_vm', the result was that 'UseNUMA' was set to false and 
'UseNUMAInterleaving' and 'MinHeapDeltaBytes' were incorrectly
modified.

The fix splits the function 'Arguments::parse' into three functions:
- 'Arguments::parse' now only parses the arguments.
- 'Arguments::adjust_before_os' adjusts the flags that must be adjusted
   *before* 'os::init_after_parsing_flags'.
- 'Arguments::adjust_after_os' adjusts the flags that must be adjusted
   *after* 'os::init_after_parsing_flags'.

Note that three functions are necessary since the flag 'UseLargePages'
has to be adjusted *before* 'os::init_2' is called.

This change also renames 'os::init' to 'os::init_before_parsing_flags'
and 'os::init_2' to 'os::init_after_parsing_args'. This was done to try 
to make the relationship between the functions in 'Arguments' and the 
functions in 'os' as clear as possible.

Testing:
JPRT

Also, running 'java -XX:+UseNUMA -XX:+PrintFlagsFinal -version' on a 
system that does not support NUMA shows that 'UseNUMAInterleaving' and 
'MinHeapDeltaBytes' now have correct values.

Thanks,
Erik


More information about the hotspot-dev mailing list