提交 a331be27 编写于 作者: M minqi

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

Summary: Supply a new flag -XX:+AssumeMP to workaround the problem. With the flag is turned on, assume VM run on MP platform so is_MP() will return true that sync calls will not skip away.
Reviewed-by: dholmes, acorn, dcubed, jmasa
Contributed-by: yumin.qi@oracle.com
上级 1db6cb76
...@@ -3325,6 +3325,13 @@ jint Arguments::parse(const JavaVMInitArgs* args) { ...@@ -3325,6 +3325,13 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
} }
check_deprecated_gcs(); check_deprecated_gcs();
check_deprecated_gc_flags(); check_deprecated_gc_flags();
if (AssumeMP && !UseSerialGC) {
if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) {
warning("If the number of processors is expected to increase from one, then"
" you should configure the number of parallel GC threads appropriately"
" using -XX:ParallelGCThreads=N");
}
}
#else // INCLUDE_ALL_GCS #else // INCLUDE_ALL_GCS
assert(verify_serial_gc_flags(), "SerialGC unset"); assert(verify_serial_gc_flags(), "SerialGC unset");
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
......
...@@ -457,6 +457,9 @@ class CommandLineFlags { ...@@ -457,6 +457,9 @@ class CommandLineFlags {
lp64_product(intx, ObjectAlignmentInBytes, 8, \ lp64_product(intx, ObjectAlignmentInBytes, 8, \
"Default object alignment in bytes, 8 is minimum") \ "Default object alignment in bytes, 8 is minimum") \
\ \
product(bool, AssumeMP, false, \
"Instruct the VM to assume multiple processors are available") \
\
/* UseMembar is theoretically a temp flag used for memory barrier \ /* UseMembar is theoretically a temp flag used for memory barrier \
* removal testing. It was supposed to be removed before FCS but has \ * removal testing. It was supposed to be removed before FCS but has \
* been re-added (see 6401008) */ \ * been re-added (see 6401008) */ \
......
...@@ -180,7 +180,7 @@ class os: AllStatic { ...@@ -180,7 +180,7 @@ class os: AllStatic {
// Interface for detecting multiprocessor system // Interface for detecting multiprocessor system
static inline bool is_MP() { static inline bool is_MP() {
assert(_processor_count > 0, "invalid processor count"); assert(_processor_count > 0, "invalid processor count");
return _processor_count > 1; return _processor_count > 1 || AssumeMP;
} }
static julong available_memory(); static julong available_memory();
static julong physical_memory(); static julong physical_memory();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册