RFR: 2178143: VM crashes if the number of bound CPUs changed during runtime

Daniel D. Daugherty daniel.daugherty at oracle.com
Wed Mar 20 22:46:46 UTC 2013


On 3/20/13 3:27 PM, Yumin Qi wrote:
> Hi, can I have your code review of a small change?
>
> 2178143:  VM crashes if the number of bound CPUs changed during runtime.
>
> Situation: Customer first configure only one CPU online and turn 
> others offline to run java application, after java program started, 
> bring more CPUs back online. Since VM started on a single CPU, 
> os::is_MP() will return false, but after more CPUs available, OS will 
> schedule the app run on multiple CPUs, this caused SEGV in various 
> places where data consistency was broken. The solution is supply a 
> flag to assume it is running on MP, so lock is forced to be called.
>
> http://cr.openjdk.java.net/~minqi/2178143/

The comments in the bug report indicate the possibility of using
the new NumberOfProcessors value as a hint for number of GC threads
with some sort of upper cap (32). I don't see that change here so
I'm guessing that may come via some other changeset...

src/share/vm/runtime/arguments.cpp

3253   // NumberOfProcessors is a flag used to assume underlying 
architecture is MP

     Instead of "assume" how about "hint that the" or "indicate that the".
     Might have to break the comment on two lines.

3257       "NumberOfProcessors should be greater that 1", NULL);

     typo: 'that 1' -> 'than 1'

src/share/vm/runtime/globals.hpp

461           "Assume number of 
processors")                                    \

     How about:

               "Hint about number of processors (must be greater than 1)"

     The above text is used by one of the special options for printing
     info about the command line options.

src/share/vm/runtime/os.hpp
     No comments.

Dan


>
> Thanks
> Yumin




More information about the hotspot-gc-dev mailing list