From 6163d27f145817c7215361125a088a943cb1b646 Mon Sep 17 00:00:00 2001 From: XMRig Date: Tue, 10 Dec 2019 11:56:31 +0700 Subject: [PATCH] Added command line option --randomx-1gb-pages --- README.md | 1 + src/base/kernel/interfaces/IConfig.h | 1 + src/core/config/ConfigTransform.cpp | 3 +++ src/core/config/Config_platform.h | 2 ++ src/core/config/usage.h | 1 + 5 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 7563ff2d..ce223261 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ CPU backend: --randomx-init=N threads count to initialize RandomX dataset --randomx-no-numa disable NUMA support for RandomX --randomx-mode=MODE RandomX mode: auto, fast, light + --randomx-1gb-pages use 1GB hugepages for dataset (Linux only) API: --api-worker-id=ID custom worker-id for API diff --git a/src/base/kernel/interfaces/IConfig.h b/src/base/kernel/interfaces/IConfig.h index dbbf82cd..94b5f90a 100644 --- a/src/base/kernel/interfaces/IConfig.h +++ b/src/base/kernel/interfaces/IConfig.h @@ -90,6 +90,7 @@ public: RandomXInitKey = 1022, RandomXNumaKey = 1023, RandomXModeKey = 1029, + RandomX1GbPagesKey = 1031, CPUMaxThreadsKey = 1026, MemoryPoolKey = 1027, YieldKey = 1030, diff --git a/src/core/config/ConfigTransform.cpp b/src/core/config/ConfigTransform.cpp index b9f66678..20a885ba 100644 --- a/src/core/config/ConfigTransform.cpp +++ b/src/core/config/ConfigTransform.cpp @@ -165,6 +165,9 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const case IConfig::RandomXModeKey: /* --randomx-mode */ return set(doc, kRandomX, "mode", arg); + + case IConfig::RandomX1GbPagesKey: /* --randomx-1gb-pages */ + return set(doc, kRandomX, "1gb-pages", true); # endif # ifdef XMRIG_FEATURE_OPENCL diff --git a/src/core/config/Config_platform.h b/src/core/config/Config_platform.h index a866c128..2a606501 100644 --- a/src/core/config/Config_platform.h +++ b/src/core/config/Config_platform.h @@ -98,6 +98,8 @@ static const option options[] = { { "randomx-init", 1, nullptr, IConfig::RandomXInitKey }, { "randomx-no-numa", 0, nullptr, IConfig::RandomXNumaKey }, { "randomx-mode", 1, nullptr, IConfig::RandomXModeKey }, + { "randomx-1gb-pages", 0, nullptr, IConfig::RandomX1GbPagesKey }, + { "1gb-pages", 0, nullptr, IConfig::RandomX1GbPagesKey }, # endif # ifdef XMRIG_FEATURE_OPENCL { "opencl", 0, nullptr, IConfig::OclKey }, diff --git a/src/core/config/usage.h b/src/core/config/usage.h index 38a48701..03526148 100644 --- a/src/core/config/usage.h +++ b/src/core/config/usage.h @@ -88,6 +88,7 @@ static inline const std::string &usage() u += " --randomx-init=N threads count to initialize RandomX dataset\n"; u += " --randomx-no-numa disable NUMA support for RandomX\n"; u += " --randomx-mode=MODE RandomX mode: auto, fast, light\n"; + u += " --randomx-1gb-pages use 1GB hugepages for dataset (Linux only)\n"; # endif # ifdef XMRIG_FEATURE_HTTP