From 1a2e922f47a25ec329006c20d5bfcf2621d45355 Mon Sep 17 00:00:00 2001 From: Martijn Muijsers Date: Sat, 24 Dec 2022 22:15:06 +0100 Subject: [PATCH] Squash CPU cores estimation patches --- .../server/0122-CPU-cores-estimation.patch | 23 ++++++++++++++ ...lude-CPU-cores-estimation-in-timings.patch | 31 ------------------- ...utility.patch => 0123-Mutex-utility.patch} | 0 ...4-Paired-lock-and-condition-utility.patch} | 0 ... 0125-Unterminable-executor-utility.patch} | 0 ... 0126-FIFO-concurrent-queue-utility.patch} | 0 ...ols.patch => 0127-Base-thread-pools.patch} | 0 ... => 0128-Non-blocking-PooledObjects.patch} | 0 8 files changed, 23 insertions(+), 31 deletions(-) delete mode 100644 patches/server/0123-Include-CPU-cores-estimation-in-timings.patch rename patches/server/{0124-Mutex-utility.patch => 0123-Mutex-utility.patch} (100%) rename patches/server/{0125-Paired-lock-and-condition-utility.patch => 0124-Paired-lock-and-condition-utility.patch} (100%) rename patches/server/{0126-Unterminable-executor-utility.patch => 0125-Unterminable-executor-utility.patch} (100%) rename patches/server/{0127-FIFO-concurrent-queue-utility.patch => 0126-FIFO-concurrent-queue-utility.patch} (100%) rename patches/server/{0128-Base-thread-pools.patch => 0127-Base-thread-pools.patch} (100%) rename patches/server/{0129-Non-blocking-PooledObjects.patch => 0128-Non-blocking-PooledObjects.patch} (100%) diff --git a/patches/server/0122-CPU-cores-estimation.patch b/patches/server/0122-CPU-cores-estimation.patch index 579eab5..737975f 100644 --- a/patches/server/0122-CPU-cores-estimation.patch +++ b/patches/server/0122-CPU-cores-estimation.patch @@ -6,6 +6,29 @@ Subject: [PATCH] CPU cores estimation License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html) Gale - https://galemc.org +diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java +index dc9d304257d86109c06ec9b7673d3ee27d5ee875..781fc0a92f73be73b9313e7bc4eeb2f2ed6ff8ea 100644 +--- a/src/main/java/co/aikar/timings/TimingsExport.java ++++ b/src/main/java/co/aikar/timings/TimingsExport.java +@@ -37,6 +37,7 @@ import org.bukkit.configuration.MemorySection; + import org.bukkit.entity.EntityType; + import org.galemc.gale.configuration.GaleGlobalConfiguration; + import org.galemc.gale.configuration.timingsexport.VanillaServerPropertiesTimingsExport; ++import org.galemc.gale.util.CPUCoresEstimation; + import org.json.simple.JSONObject; + import org.json.simple.JSONValue; + import oshi.SystemInfo; +@@ -206,6 +207,10 @@ public class TimingsExport extends Thread { + pair("finalizing", ManagementFactory.getMemoryMXBean().getObjectPendingFinalizationCount()) + )), + pair("cpu", runtime.availableProcessors()), ++ // Gale start - CPU cores estimation - include in timings ++ pair("cpucoresestimation", CPUCoresEstimation.get()), ++ pair("cpuphysicalprocessorcount", processor.getPhysicalProcessorCount()), ++ // Gale end - CPU cores estimation - include in timings + pair("cpuname", hardwareInfo.getProcessor().getProcessorIdentifier().getName().trim()), + pair("hardwarespecs", hardwareSpecsMap), // Gale - include hardware specs in timings + pair("runtime", runtimeBean.getUptime()), diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java index f5ed3fa20097bdd43a25c76b38353a23743bc9e5..eed9f125df46b616b7234a2d669971bc51bc231b 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/patches/server/0123-Include-CPU-cores-estimation-in-timings.patch b/patches/server/0123-Include-CPU-cores-estimation-in-timings.patch deleted file mode 100644 index 91b36fa..0000000 --- a/patches/server/0123-Include-CPU-cores-estimation-in-timings.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Martijn Muijsers -Date: Sat, 24 Dec 2022 22:03:32 +0100 -Subject: [PATCH] Include CPU cores estimation in timings - -License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html) -Gale - https://galemc.org - -diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java -index dc9d304257d86109c06ec9b7673d3ee27d5ee875..32da69dcab868d2fa9775c6384c4403be10c0c97 100644 ---- a/src/main/java/co/aikar/timings/TimingsExport.java -+++ b/src/main/java/co/aikar/timings/TimingsExport.java -@@ -37,6 +37,7 @@ import org.bukkit.configuration.MemorySection; - import org.bukkit.entity.EntityType; - import org.galemc.gale.configuration.GaleGlobalConfiguration; - import org.galemc.gale.configuration.timingsexport.VanillaServerPropertiesTimingsExport; -+import org.galemc.gale.util.CPUCoresEstimation; - import org.json.simple.JSONObject; - import org.json.simple.JSONValue; - import oshi.SystemInfo; -@@ -206,6 +207,10 @@ public class TimingsExport extends Thread { - pair("finalizing", ManagementFactory.getMemoryMXBean().getObjectPendingFinalizationCount()) - )), - pair("cpu", runtime.availableProcessors()), -+ // Gale start - include CPU cores estimation in timings -+ pair("cpucoresestimation", CPUCoresEstimation.get()), -+ pair("cpuphysicalprocessorcount", processor.getPhysicalProcessorCount()), -+ // Gale end - include CPU cores estimation in timings - pair("cpuname", hardwareInfo.getProcessor().getProcessorIdentifier().getName().trim()), - pair("hardwarespecs", hardwareSpecsMap), // Gale - include hardware specs in timings - pair("runtime", runtimeBean.getUptime()), diff --git a/patches/server/0124-Mutex-utility.patch b/patches/server/0123-Mutex-utility.patch similarity index 100% rename from patches/server/0124-Mutex-utility.patch rename to patches/server/0123-Mutex-utility.patch diff --git a/patches/server/0125-Paired-lock-and-condition-utility.patch b/patches/server/0124-Paired-lock-and-condition-utility.patch similarity index 100% rename from patches/server/0125-Paired-lock-and-condition-utility.patch rename to patches/server/0124-Paired-lock-and-condition-utility.patch diff --git a/patches/server/0126-Unterminable-executor-utility.patch b/patches/server/0125-Unterminable-executor-utility.patch similarity index 100% rename from patches/server/0126-Unterminable-executor-utility.patch rename to patches/server/0125-Unterminable-executor-utility.patch diff --git a/patches/server/0127-FIFO-concurrent-queue-utility.patch b/patches/server/0126-FIFO-concurrent-queue-utility.patch similarity index 100% rename from patches/server/0127-FIFO-concurrent-queue-utility.patch rename to patches/server/0126-FIFO-concurrent-queue-utility.patch diff --git a/patches/server/0128-Base-thread-pools.patch b/patches/server/0127-Base-thread-pools.patch similarity index 100% rename from patches/server/0128-Base-thread-pools.patch rename to patches/server/0127-Base-thread-pools.patch diff --git a/patches/server/0129-Non-blocking-PooledObjects.patch b/patches/server/0128-Non-blocking-PooledObjects.patch similarity index 100% rename from patches/server/0129-Non-blocking-PooledObjects.patch rename to patches/server/0128-Non-blocking-PooledObjects.patch