Comment out vestigial test code (improves mt performance)

This commit is contained in:
Joseph Henry 2024-09-06 09:52:39 -07:00
parent c86b91c5f0
commit 059d05f41f
No known key found for this signature in database
GPG Key ID: C45B33FF5EBC9344
2 changed files with 11 additions and 7 deletions

View File

@ -62,7 +62,7 @@ void PacketMultiplexer::putFrame(void* tPtr, uint64_t nwid, void** nuptr, const
memcpy(packet->data, data, len);
int bucket = flowId % _concurrency;
_rxPacketQueues[bucket]->postLimit(packet, 256);
_rxPacketQueues[bucket]->postLimit(packet, 2048);
}
void PacketMultiplexer::setUpPostDecodeReceiveThreads(unsigned int concurrency, bool cpuPinningEnabled)

View File

@ -997,12 +997,13 @@ public:
_node->initMultithreading(_concurrency, _cpuPinningEnabled);
bool pinning = _cpuPinningEnabled;
/*
fprintf(stderr, "Starting %d RX threads\n", _concurrency);
for (unsigned int i = 0; i < _concurrency; ++i) {
_rxPacketThreads.push_back(std::thread([this, i, pinning]() {
if (pinning) {
#if defined(__LINUX__) || defined(__FreeBSD__) /* || defined(__APPLE__) */
#if defined(__LINUX__) || defined(__FreeBSD__) // || defined(__APPLE__)
int pinCore = i % _concurrency;
fprintf(stderr, "CPU Pinning enabled. Pinning thread %d to core %d\n", i, pinCore);
pthread_t self = pthread_self();
@ -1015,7 +1016,7 @@ public:
#elif __FreeBSD__
int rc = pthread_setaffinity_np(self, sizeof(cpu_set_t), &cpuset);
#endif
#if defined(__LINUX__) || defined(__FreeBSD__) /* || defined(__APPLE__) */
#if defined(__LINUX__) || defined(__FreeBSD__) // || defined(__APPLE__)
if (rc != 0)
{
fprintf(stderr, "failed to pin rx thread %d to core %d: %s\n", i, pinCore, strerror(errno));
@ -1048,6 +1049,7 @@ public:
}
}));
}
*/
}
virtual ReasonForTermination run()
@ -2997,6 +2999,7 @@ public:
if ((len >= 16) && (reinterpret_cast<const InetAddress*>(from)->ipScope() == InetAddress::IP_SCOPE_GLOBAL)) {
_lastDirectReceiveFromGlobal = now;
}
/*
#if defined(__LINUX__) || defined(__FreeBSD__)
if (_multicoreEnabled) {
PacketRecord* packet;
@ -3015,10 +3018,11 @@ public:
memcpy(&(packet->from), from, sizeof(struct sockaddr_storage));
packet->size = (unsigned int)len;
memcpy(packet->data, data, len);
_rxPacketQueue.postLimit(packet, 256 * _concurrency);
_rxPacketQueue.postLimit(packet, 2048 * _concurrency);
}
else {
#endif
*/
const ZT_ResultCode rc = _node->processWirePacket(nullptr,now,reinterpret_cast<int64_t>(sock),reinterpret_cast<const struct sockaddr_storage *>(from),data,len,&_nextBackgroundTaskDeadline);
if (ZT_ResultCode_isFatal(rc)) {
char tmp[256];
@ -3028,9 +3032,9 @@ public:
_fatalErrorMessage = tmp;
this->terminate();
}
#if defined(__LINUX__) || defined(__FreeBSD__)
}
#endif
//#if defined(__LINUX__) || defined(__FreeBSD__)
// }
//#endif
}