diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp index 915610051748794f356ecb4ecb9871d46df8ad32..217d82798c9a26616645f2343898a19877835a2c 100644 --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -3325,6 +3325,13 @@ jint Arguments::parse(const JavaVMInitArgs* args) { } check_deprecated_gcs(); 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 assert(verify_serial_gc_flags(), "SerialGC unset"); #endif // INCLUDE_ALL_GCS diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp index e73e5089babee13cf54e97ca18ade34f439aaec6..4f3fcbb369b04a9a6f3715989e11ad25b97b6b44 100644 --- a/src/share/vm/runtime/globals.hpp +++ b/src/share/vm/runtime/globals.hpp @@ -457,6 +457,9 @@ class CommandLineFlags { lp64_product(intx, ObjectAlignmentInBytes, 8, \ "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 \ * removal testing. It was supposed to be removed before FCS but has \ * been re-added (see 6401008) */ \ diff --git a/src/share/vm/runtime/os.hpp b/src/share/vm/runtime/os.hpp index d061a0848c6126db813236a09408ddecf260e52b..f5dc130545a269e8d98c3dc11ac253cf87580476 100644 --- a/src/share/vm/runtime/os.hpp +++ b/src/share/vm/runtime/os.hpp @@ -180,7 +180,7 @@ class os: AllStatic { // Interface for detecting multiprocessor system static inline bool is_MP() { assert(_processor_count > 0, "invalid processor count"); - return _processor_count > 1; + return _processor_count > 1 || AssumeMP; } static julong available_memory(); static julong physical_memory();