From 0e57053c5a2324516d1cc9935f2f71b7d38ef7c0 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Tue, 19 Apr 2022 19:57:12 +0200 Subject: [PATCH] Fixed --cpu-priority not working sometimes --- src/core/config/ConfigTransform.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/config/ConfigTransform.cpp b/src/core/config/ConfigTransform.cpp index 620800a92..9d24f19ca 100644 --- a/src/core/config/ConfigTransform.cpp +++ b/src/core/config/ConfigTransform.cpp @@ -319,16 +319,18 @@ void xmrig::ConfigTransform::transformUint64(rapidjson::Document &doc, int key, #ifdef XMRIG_FEATURE_BENCHMARK void xmrig::ConfigTransform::transformBenchmark(rapidjson::Document &doc, int key, const char *arg) { - set(doc, CpuConfig::kField, CpuConfig::kHugePagesJit, true); - set(doc, CpuConfig::kField, CpuConfig::kPriority, 2); - set(doc, CpuConfig::kField, CpuConfig::kYield, false); - switch (key) { case IConfig::AlgorithmKey: /* --algo */ return set(doc, BenchConfig::kBenchmark, BenchConfig::kAlgo, arg); case IConfig::BenchKey: /* --bench */ + { + // CPU settings for the benchmark + set(doc, CpuConfig::kField, CpuConfig::kHugePagesJit, true); + set(doc, CpuConfig::kField, CpuConfig::kPriority, 2); + set(doc, CpuConfig::kField, CpuConfig::kYield, false); return set(doc, BenchConfig::kBenchmark, BenchConfig::kSize, arg); + } case IConfig::StressKey: /* --stress */ return add(doc, Pools::kPools, Pool::kUser, BenchConfig::kBenchmark);