diff options
| author | mischief <mischief@offblast.org> | 2026-08-20 17:57:27 -0300 |
|---|---|---|
| committer | bitflash <admin@bitflash.network> | 2026-08-20 17:57:27 -0300 |
| commit | 3a128281cd8fec1c698346191c240a771f80d72c (patch) | |
| tree | ee4bd622380b62b81a64d791cbeac0eec5ab5422 /src/main_gui.cpp | |
| parent | 721a7e46fadba3251564e2308b7b7eefcb2e9d36 (diff) | |
randomx: optional 2 MB large pages for the cache, dataset and scratchpads
RandomX reads its 256 MB cache, 2 GB dataset and per-VM scratchpads at random,
so most accesses miss the TLB on 4 KB pages. Requesting 2 MB pages recovers
roughly a tenth of the hash rate. Each allocation tries large pages first and
falls back to normal pages when the pool is not reserved, so nothing regresses
when hugepages are unavailable. -nolargepages opts out, and the diagnostics
report which allocations got large pages.
Diffstat (limited to 'src/main_gui.cpp')
| -rw-r--r-- | src/main_gui.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 0a961bf..a01bdee 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp | |||
| @@ -127,6 +127,8 @@ static void PrintUsage() | |||
| 127 | printf(" /stratumbridgeport=N (default 3333; listen on 127.0.0.1)\n"); | 127 | printf(" /stratumbridgeport=N (default 3333; listen on 127.0.0.1)\n"); |
| 128 | printf(" /solomine\n"); | 128 | printf(" /solomine\n"); |
| 129 | printf(" /genproclimit=N (mining threads; 0 or absent = every core but one)\n"); | 129 | printf(" /genproclimit=N (mining threads; 0 or absent = every core but one)\n"); |
| 130 | printf(" /nolargepages (do not ask for 2 MB pages for the RandomX\n"); | ||
| 131 | printf(" cache, dataset and scratchpads)\n"); | ||
| 130 | printf(" /checkblocks=N (blocks re-verified at startup, default 288, 0 = all)\n"); | 132 | printf(" /checkblocks=N (blocks re-verified at startup, default 288, 0 = all)\n"); |
| 131 | printf("\n"); | 133 | printf("\n"); |
| 132 | printf("Pool operator announcement:\n"); | 134 | printf("Pool operator announcement:\n"); |
| @@ -230,6 +232,11 @@ static void ParseStartupArguments(int argc, char* argv[]) | |||
| 230 | if (!strCheckBlocks.empty()) | 232 | if (!strCheckBlocks.empty()) |
| 231 | nCheckBlocksOnLoad = atoi(strCheckBlocks.c_str()); | 233 | nCheckBlocksOnLoad = atoi(strCheckBlocks.c_str()); |
| 232 | 234 | ||
| 235 | // Must be read before LoadBlockIndex(), which is what first calls | ||
| 236 | // RandomXInit() and fixes how the cache is allocated. | ||
| 237 | if (arg(argc,argv,"/nolargepages") || arg(argc,argv,"-nolargepages")) | ||
| 238 | fRandomXLargePages = false; | ||
| 239 | |||
| 233 | // /genproclimit=N -- threads to hash with. 0 or absent means automatic, | 240 | // /genproclimit=N -- threads to hash with. 0 or absent means automatic, |
| 234 | // which is every core but one. Named after Bitcoin's own option so it reads | 241 | // which is every core but one. Named after Bitcoin's own option so it reads |
| 235 | // familiarly to anyone who has run one of these before. | 242 | // familiarly to anyone who has run one of these before. |