Fixed dataset initialization speed on Linux if thread affinity was used.
This commit is contained in:
parent
ccd5fae5e1
commit
d4772cbd5d
9 changed files with 95 additions and 51 deletions
|
@ -295,7 +295,7 @@ rapidjson::Value xmrig::CpuBackend::toJSON(rapidjson::Document &doc) const
|
|||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
if (d_ptr->algo.family() == Algorithm::RANDOM_X) {
|
||||
RxDataset *dataset = Rx::dataset();
|
||||
RxDataset *dataset = Rx::dataset(-1); // FIXME
|
||||
if (dataset) {
|
||||
const auto rxPages = dataset->hugePages();
|
||||
pages[0] += rxPages.first;
|
||||
|
|
|
@ -29,11 +29,6 @@
|
|||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_ALGO_RANDOMX
|
||||
# include "crypto/rx/Rx.h"
|
||||
#endif
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
static const char *kCn = "cn";
|
||||
|
@ -140,10 +135,6 @@ void xmrig::CpuConfig::read(const rapidjson::Value &value)
|
|||
m_assembly = Json::getValue(value, kAsm);
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
Rx::setInitThreads(m_initThreads);
|
||||
# endif
|
||||
|
||||
if (!m_threads.read(value)) {
|
||||
generate();
|
||||
}
|
||||
|
|
|
@ -56,6 +56,7 @@ public:
|
|||
inline bool isShouldSave() const { return m_shouldSave; }
|
||||
inline const Assembly &assembly() const { return m_assembly; }
|
||||
inline const Threads<CpuThread> &threads() const { return m_threads; }
|
||||
inline int initThreads() const { return m_initThreads; }
|
||||
inline int priority() const { return m_priority; }
|
||||
|
||||
private:
|
||||
|
|
|
@ -81,7 +81,15 @@ xmrig::CpuWorker<N>::~CpuWorker()
|
|||
template<size_t N>
|
||||
void xmrig::CpuWorker<N>::allocateRandomX_VM()
|
||||
{
|
||||
RxDataset *dataset = Rx::dataset(m_job.currentJob().seedHash(), m_job.currentJob().algorithm());
|
||||
while (!Rx::isReady(m_job.currentJob(), m_affinity)) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
|
||||
if (Nonce::sequence(Nonce::CPU) == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
RxDataset *dataset = Rx::dataset(m_affinity);
|
||||
|
||||
if (!m_vm) {
|
||||
m_vm = new RxVm(dataset, m_memory->scratchpad(), !m_hwAES);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue