1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-24 05:23:16 -05:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Tony Butler
54caaa9227 Merge 6c8098378a into 8afd4d5f2f 2024-01-16 13:55:16 -08:00
Tony Butler
6c8098378a Add AUTO_HUGEPAGE feature to disable writing to nr_hugepages 2023-07-12 02:06:53 -06:00
5 changed files with 20 additions and 32 deletions

View File

@@ -1,8 +1,3 @@
# v6.21.1
- [#3391](https://github.com/xmrig/xmrig/pull/3391) Added support for townforge (monero fork using randomx).
- [#3399](https://github.com/xmrig/xmrig/pull/3399) Fixed Zephyr mining (OpenCL).
- [#3420](https://github.com/xmrig/xmrig/pull/3420) Fixed segfault in HTTP API rebind.
# v6.21.0
- [#3302](https://github.com/xmrig/xmrig/pull/3302) [#3312](https://github.com/xmrig/xmrig/pull/3312) Enabled keepalive for Windows (>= Vista).
- [#3320](https://github.com/xmrig/xmrig/pull/3320) Added "built for OS/architecture/bits" to "ABOUT".

View File

@@ -32,6 +32,7 @@ option(WITH_VAES "Enable VAES instructions for Cryptonight" ON)
option(WITH_BENCHMARK "Enable builtin RandomX benchmark and stress test" ON)
option(WITH_SECURE_JIT "Enable secure access to JIT memory" OFF)
option(WITH_DMI "Enable DMI/SMBIOS reader" ON)
option(WITH_AUTO_HUGEPAGE "Enable Automatic setting of nr_hugepages (Linux Only)" ON)
option(BUILD_STATIC "Build static binary" OFF)
option(ARM_V8 "Force ARMv8 (64 bit) architecture, use with caution if automatic detection fails, but you sure it may work" OFF)
@@ -181,6 +182,10 @@ else()
if (XMRIG_OS_ANDROID)
set(EXTRA_LIBS pthread rt dl log)
elseif (XMRIG_OS_LINUX)
if (WITH_AUTO_HUGEPAGE)
add_definitions(/DXMRIG_FEATURE_AUTO_HUGEPAGE)
endif()
list(APPEND SOURCES_OS
src/crypto/common/LinuxMemory.h
src/crypto/common/LinuxMemory.cpp

View File

@@ -39,7 +39,6 @@
#include <thread>
#include <iostream>
namespace xmrig {
@@ -81,8 +80,7 @@ static rapidjson::Value getResources(rapidjson::Document &doc)
xmrig::Api::Api(Base *base) :
m_base(base),
m_timestamp(Chrono::currentMSecsSinceEpoch()),
m_httpd(nullptr)
m_timestamp(Chrono::currentMSecsSinceEpoch())
{
base->addListener(this);
@@ -93,11 +91,7 @@ xmrig::Api::Api(Base *base) :
xmrig::Api::~Api()
{
# ifdef XMRIG_FEATURE_HTTP
if (m_httpd) {
m_httpd->stop();
delete m_httpd;
m_httpd = nullptr; // Ensure the pointer is set to nullptr after deletion
}
delete m_httpd;
# endif
}
@@ -115,14 +109,8 @@ void xmrig::Api::start()
genWorkerId(m_base->config()->apiWorkerId());
# ifdef XMRIG_FEATURE_HTTP
if (!m_httpd) {
m_httpd = new Httpd(m_base);
if (!m_httpd->start()) {
std::cerr << "HTTP server failed to start." << std::endl;
delete m_httpd; // Properly handle failure to start
m_httpd = nullptr;
}
}
m_httpd = new Httpd(m_base);
m_httpd->start();
# endif
}
@@ -130,9 +118,7 @@ void xmrig::Api::start()
void xmrig::Api::stop()
{
# ifdef XMRIG_FEATURE_HTTP
if (m_httpd) {
m_httpd->stop();
}
m_httpd->stop();
# endif
}
@@ -140,15 +126,13 @@ void xmrig::Api::stop()
void xmrig::Api::tick()
{
# ifdef XMRIG_FEATURE_HTTP
if (!m_httpd || !m_base->config()->http().isEnabled() || m_httpd->isBound()) {
if (m_httpd->isBound() || !m_base->config()->http().isEnabled()) {
return;
}
if (++m_ticks % 10 == 0) {
m_ticks = 0;
if (m_httpd) {
m_httpd->start();
}
m_httpd->start();
}
# endif
}

View File

@@ -60,7 +60,11 @@ bool xmrig::LinuxMemory::reserve(size_t size, uint32_t node, size_t hugePageSize
return false;
}
# ifdef XMRIG_FEATURE_AUTO_HUGEPAGE
return write_nr_hugepages(node, hugePageSize, std::max<size_t>(nr_hugepages(node, hugePageSize), 0) + (required - available));
# else
return false;
# endif
}

View File

@@ -1,6 +1,6 @@
/* XMRig
* Copyright (c) 2018-2024 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2024 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,10 +22,10 @@
#define APP_ID "xmrig"
#define APP_NAME "XMRig"
#define APP_DESC "XMRig miner"
#define APP_VERSION "6.21.1"
#define APP_VERSION "6.21.1-dev"
#define APP_DOMAIN "xmrig.com"
#define APP_SITE "www.xmrig.com"
#define APP_COPYRIGHT "Copyright (C) 2016-2024 xmrig.com"
#define APP_COPYRIGHT "Copyright (C) 2016-2023 xmrig.com"
#define APP_KIND "miner"
#define APP_VER_MAJOR 6