Subject: [PATCH][Huawei] Fix the ActiveProcessorCount function of the spark service became invalid --- hotspot/src/os/linux/vm/os_linux.cpp | 4 ---- hotspot/src/share/vm/runtime/os.cpp | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 222c81d64..6ee49eedc 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -5576,10 +5576,6 @@ jint os::init_2(void) Linux::is_floating_stack() ? "floating stack" : "fixed stack"); } -#ifdef AARCH64 - JavaThread::os_linux_aarch64_options(active_processor_count(), argv_for_execvp); -#endif - if (UseNUMA) { if (!Linux::libnuma_init()) { UseNUMA = false; diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index ff35e8b3a..cae1cf477 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -366,6 +366,11 @@ static void signal_thread_entry(JavaThread* thread, TRAPS) { } void os::init_before_ergo() { +#ifdef AARCH64 + // global variables + extern char** argv_for_execvp; + JavaThread::os_linux_aarch64_options(active_processor_count(), argv_for_execvp); +#endif initialize_initial_active_processor_count(); // We need to initialize large page support here because ergonomics takes some // decisions depending on large page support and the calculated large page size. -- 2.44.0