From efe6847f0d688e0f476b3d8ce1e1d4ddd276cafa Mon Sep 17 00:00:00 2001 From: Benshuai5D Date: Tue, 30 Jul 2024 22:06:23 +0800 Subject: [PATCH] Fix the ActiveProcessorCount function of the spark service became invalid --- ...ocessorCount-function-of-the-spark-s.patch | 42 +++++++++++++++++++ openjdk-1.8.0.spec | 9 +++- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 Fix-the-ActiveProcessorCount-function-of-the-spark-s.patch diff --git a/Fix-the-ActiveProcessorCount-function-of-the-spark-s.patch b/Fix-the-ActiveProcessorCount-function-of-the-spark-s.patch new file mode 100644 index 0000000..b7fedb5 --- /dev/null +++ b/Fix-the-ActiveProcessorCount-function-of-the-spark-s.patch @@ -0,0 +1,42 @@ +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 + diff --git a/openjdk-1.8.0.spec b/openjdk-1.8.0.spec index 275940d..d83a90b 100644 --- a/openjdk-1.8.0.spec +++ b/openjdk-1.8.0.spec @@ -943,7 +943,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever}.%{buildver} -Release: 2 +Release: 3 # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons # and this change was brought into RHEL-4. java-1.5.0-ibm packages # also included the epoch in their virtual provides. This created a @@ -1340,7 +1340,8 @@ Patch439: Backport-8151845-Comment-in-globals.hpp-for-MetaspaceSize-is-.patch Patch440: Backport-8210706-G1-may-deadlock-when-starting-a-concurrent-c.patch Patch441: Backport-8318889-Backport-Important-Fixed-Issues-in-Later-Ver.patch Patch442: Huawei-Keep-objects-when-remove-unshareable-info.patch -Patch443: The-fast-serialization-function-of-sun.rmi.transport.patch +Patch443: The-fast-serialization-function-of-sun.rmi.transport.patch +Patch444: Fix-the-ActiveProcessorCount-function-of-the-spark-s.patch ############################################# # # Upstreamable patches @@ -1997,6 +1998,7 @@ pushd %{top_level_dir_name} %patch441 -p1 %patch442 -p1 %patch443 -p1 +%patch444 -p1 %endif %ifarch loongarch64 @@ -2662,6 +2664,9 @@ cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect %endif %changelog +* Tue Jul 30 2024 benshuai5D -1:1.8.0.422-b05.3 +- Fix-the-ActiveProcessorCount-function-of-the-spark-s.patch + * Tue Jul 30 2024 Xiang Gao - 1:1.8.0.422-b05.2 - Backport 8178498,8193710,8196743,8284330, serviceability tools support containers on loongarch -- Gitee