1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-24 21:32:47 -05:00

Linux: added support for transparent huge pages

This commit is contained in:
SChernykh
2025-12-11 11:23:18 +01:00
parent 856813c1ae
commit 482a1f0b40
8 changed files with 32 additions and 5 deletions

View File

@@ -75,6 +75,16 @@ xmrig::VirtualMemory::VirtualMemory(size_t size, bool hugePages, bool oneGbPages
}
m_scratchpad = static_cast<uint8_t*>(_mm_malloc(m_size, alignSize));
// Huge pages failed to allocate, but try to enable transparent huge pages for the range
if (alignSize >= kDefaultHugePageSize) {
if (m_scratchpad) {
adviseLargePages(m_scratchpad, m_size);
}
else {
m_scratchpad = static_cast<uint8_t*>(_mm_malloc(m_size, 64));
}
}
}