upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/randomx_pow.h
diff options
context:
space:
mode:
authormischief <mischief@offblast.org>2026-08-20 17:57:27 -0300
committerbitflash <admin@bitflash.network>2026-08-20 17:57:27 -0300
commit3a128281cd8fec1c698346191c240a771f80d72c (patch)
treeee4bd622380b62b81a64d791cbeac0eec5ab5422 /src/randomx_pow.h
parent721a7e46fadba3251564e2308b7b7eefcb2e9d36 (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/randomx_pow.h')
-rw-r--r--src/randomx_pow.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/randomx_pow.h b/src/randomx_pow.h
index 0027571..355b708 100644
--- a/src/randomx_pow.h
+++ b/src/randomx_pow.h
@@ -41,4 +41,11 @@ uint256 RandomXHashWithVM(void* vm, const void* pHeader, size_t nSize);
41// True when the 2 GB dataset is ready (fast mode active). 41// True when the 2 GB dataset is ready (fast mode active).
42bool RandomXFastReady(); 42bool RandomXFastReady();
43 43
44// Ask for large (2 MB) pages for the cache, dataset and scratchpads. Set false
45// by -nolargepages. Must be set before the first RandomXInit().
46extern bool fRandomXLargePages;
47
48// Which allocations actually got large pages, for the status display.
49const char* RandomXLargePagesStatus();
50
44#endif 51#endif