From 9ff4ec328821f9353f3ca433ca3a1a79d75afafe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Gr=C3=A4f?= Date: Thu, 12 Jul 2018 12:48:58 +0200 Subject: [PATCH] Cleanup hugepages status --- CHANGELOG.md | 2 +- index.html | 3 +-- src/Mem_unix.cpp | 2 ++ src/cc/ClientStatus.cpp | 16 ---------------- src/cc/ClientStatus.h | 4 ---- 5 files changed, 4 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 416626e6..8ac774d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # 1.6.5 - Hashrate improve -> add autodetection mode for cpu-affinity - Hashrate improve, more stable hashrates -> refactor memory allocation -- Add Arto (RTO) support (cn [2mb scratchpag] + ipbc mod) +- Add Arto (RTO) support (cn [2mb scratchpad] + ipbc mod) - Add TubeV4 (TUBE) support (cn-heavy [4mb scratchpad] + ipbc mod + soft-aes mod) - Add external IP to log view - Fix memory leak in RemoteLog diff --git a/index.html b/index.html index 53f6c41f..49d82dd1 100644 --- a/index.html +++ b/index.html @@ -567,8 +567,7 @@ tooltip += '\n'; tooltip += "CPU Cache L2/L3: " + (row.client_status.cpu_l2 / 1024) + " MB/"+ (row.client_status.cpu_l3 / 1024) + " MB"; tooltip += '\n'; - tooltip += "Huge Pages: " + (row.client_status.hugepages_available ? " available, " : " unavailable, "); - tooltip += (row.client_status.hugepages_enabled ? "enabled" : "disabled"); + tooltip += "Huge Pages: " + (row.client_status.hugepages_available ? " available" : " unavailable"); tooltip += '\n'; tooltip += "Used Threads: " + row.client_status.current_threads; tooltip += (row.client_status.hash_factor > 1 ? " [" + row.client_status.hash_factor + "x multi hash mode]" :""); diff --git a/src/Mem_unix.cpp b/src/Mem_unix.cpp index 48fd56f3..619d9ed6 100644 --- a/src/Mem_unix.cpp +++ b/src/Mem_unix.cpp @@ -59,6 +59,8 @@ void Mem::allocate(ScratchPadMem& scratchPadMem, bool useHugePages) return allocate(scratchPadMem, false); } + m_flags |= HugepagesAvailable; + scratchPadMem.hugePages = scratchPadMem.pages; if (madvise(scratchPadMem.memory, scratchPadMem.size, MADV_RANDOM | MADV_WILLNEED) != 0) { diff --git a/src/cc/ClientStatus.cpp b/src/cc/ClientStatus.cpp index 1cb60b7a..76724c66 100644 --- a/src/cc/ClientStatus.cpp +++ b/src/cc/ClientStatus.cpp @@ -34,7 +34,6 @@ ClientStatus::ClientStatus() : m_currentStatus(Status::PAUSED), m_hasHugepages(false), - m_isHugepagesEnabled(false), m_isCpuX64(false), m_hasCpuAES(false), m_hashFactor(1), @@ -158,16 +157,6 @@ void ClientStatus::setHugepages(bool hasHugepages) m_hasHugepages = hasHugepages; } -bool ClientStatus::isHugepagesEnabled() const -{ - return m_isHugepagesEnabled; -} - -void ClientStatus::setHugepagesEnabled(bool hugepagesEnabled) -{ - m_isHugepagesEnabled = hugepagesEnabled; -} - int ClientStatus::getHashFactor() const { return m_hashFactor; @@ -400,10 +389,6 @@ bool ClientStatus::parseFromJson(const rapidjson::Document& document) m_hasHugepages = clientStatus["hugepages_available"].GetBool(); } - if (clientStatus.HasMember("hugepages_enabled")) { - m_isHugepagesEnabled = clientStatus["hugepages_enabled"].GetBool(); - } - if (clientStatus.HasMember("hash_factor")) { m_hashFactor = clientStatus["hash_factor"].GetInt(); } @@ -502,7 +487,6 @@ rapidjson::Value ClientStatus::toJson(rapidjson::MemoryPoolAllocator