Github user gtenev commented on a diff in the pull request:
https://github.com/apache/trafficserver/pull/956#discussion_r78275728
--- Diff: iocore/eventsystem/UnixEventProcessor.cc ---
@@ -129,34 +197,58 @@ EventProcessor::start(int n_event_threads, size_t
stacksize)
obj_name = (char *)"Machine";
}
+ // How many of the above `obj_type` do we have in our topology?
obj_count = hwloc_get_nbobjs_by_type(ink_get_topology(), obj_type);
Debug("iocore_thread", "Affinity: %d %ss: %d PU: %d", affinity,
obj_name, obj_count, ink_number_of_processors());
#endif
for (i = 0; i < n_ethreads; i++) {
ink_thread tid;
- if (i > 0) {
- snprintf(thr_name, MAX_THREAD_NAME_LENGTH, "[ET_NET %d]", i);
- tid = all_ethreads[i]->start(thr_name, stacksize);
- } else {
- tid = ink_thread_self();
- }
+
#if TS_USE_HWLOC
if (obj_count > 0) {
+ // Get our `obj` instance with index based on the thread number we
are on.
obj = hwloc_get_obj_by_type(ink_get_topology(), obj_type, i %
obj_count);
--- End diff --
We could defensively check/handle ``NULL`` to "protect" ``obj->cpuset``
later.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---