RandomX: added huge-pages-jit config parameter

Set to false by default, gives 0.2% boost on Ryzen 7 3700X with 16 threads, but hashrate might be unstable on Ryzen between launches. Use with caution.
This commit is contained in:
SChernykh 2020-10-07 17:42:55 +02:00
parent a8466a139c
commit 44dcded866
23 changed files with 62 additions and 26 deletions

View file

@ -47,7 +47,11 @@ xmrig::MemoryPool::MemoryPool(size_t size, bool hugePages, uint32_t node)
return;
}
m_memory = new VirtualMemory(size * pageSize, hugePages, false, false, node);
constexpr size_t alignment = 1 << 24;
m_memory = new VirtualMemory(size * pageSize + alignment, hugePages, false, false, node);
m_alignOffset = (alignment - (((size_t)m_memory->scratchpad()) % alignment)) % alignment;
}
@ -71,7 +75,7 @@ uint8_t *xmrig::MemoryPool::get(size_t size, uint32_t)
return nullptr;
}
uint8_t *out = m_memory->scratchpad() + m_offset;
uint8_t *out = m_memory->scratchpad() + m_alignOffset + m_offset;
m_offset += size;
++m_refs;