Merge pull request #3031 from SChernykh/dev

Fixed --cpu-priority not working sometimes
This commit is contained in:
xmrig 2022-04-20 07:44:33 +07:00 committed by GitHub
commit 1ae9a4e428
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);