You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2019/11/14 03:46:56 UTC
[trafficserver] branch 9.0.x updated: Fixed build issues with hwloc
2.x API changes
This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new eed5cd8 Fixed build issues with hwloc 2.x API changes
eed5cd8 is described below
commit eed5cd8d21564325402769fce5f8e4d9d777bf89
Author: Bryan Call <bc...@apache.org>
AuthorDate: Fri Nov 8 11:37:23 2019 -0800
Fixed build issues with hwloc 2.x API changes
(cherry picked from commit e655af7faeaaadd182ce17fd5bd617cafc95aff7)
---
iocore/aio/AIO.cc | 5 +++++
iocore/eventsystem/UnixEventProcessor.cc | 9 +++++++++
2 files changed, 14 insertions(+)
diff --git a/iocore/aio/AIO.cc b/iocore/aio/AIO.cc
index 07eb8ae..5543919 100644
--- a/iocore/aio/AIO.cc
+++ b/iocore/aio/AIO.cc
@@ -192,9 +192,14 @@ struct AIOThreadInfo : public Continuation {
(void)event;
(void)e;
#if TS_USE_HWLOC
+#if HWLOC_API_VERSION >= 0x20000
+ hwloc_set_membind(ink_get_topology(), hwloc_topology_get_topology_nodeset(ink_get_topology()), HWLOC_MEMBIND_INTERLEAVE,
+ HWLOC_MEMBIND_THREAD | HWLOC_MEMBIND_BYNODESET);
+#else
hwloc_set_membind_nodeset(ink_get_topology(), hwloc_topology_get_topology_nodeset(ink_get_topology()), HWLOC_MEMBIND_INTERLEAVE,
HWLOC_MEMBIND_THREAD);
#endif
+#endif
aio_thread_main(this);
delete this;
return EVENT_DONE;
diff --git a/iocore/eventsystem/UnixEventProcessor.cc b/iocore/eventsystem/UnixEventProcessor.cc
index 2661b67..c2f7fad 100644
--- a/iocore/eventsystem/UnixEventProcessor.cc
+++ b/iocore/eventsystem/UnixEventProcessor.cc
@@ -230,7 +230,11 @@ ThreadAffinityInitializer::alloc_numa_stack(EThread *t, size_t stacksize)
if (mem_policy != HWLOC_MEMBIND_DEFAULT) {
// Let's temporarily set the memory binding to our destination NUMA node
+#if HWLOC_API_VERSION >= 0x20000
+ hwloc_set_membind(ink_get_topology(), nodeset, mem_policy, HWLOC_MEMBIND_THREAD | HWLOC_MEMBIND_BYNODESET);
+#else
hwloc_set_membind_nodeset(ink_get_topology(), nodeset, mem_policy, HWLOC_MEMBIND_THREAD);
+#endif
}
// Alloc our stack
@@ -238,8 +242,13 @@ ThreadAffinityInitializer::alloc_numa_stack(EThread *t, size_t stacksize)
if (mem_policy != HWLOC_MEMBIND_DEFAULT) {
// Now let's set it back to default for this thread.
+#if HWLOC_API_VERSION >= 0x20000
+ hwloc_set_membind(ink_get_topology(), hwloc_topology_get_topology_nodeset(ink_get_topology()), HWLOC_MEMBIND_DEFAULT,
+ HWLOC_MEMBIND_THREAD | HWLOC_MEMBIND_BYNODESET);
+#else
hwloc_set_membind_nodeset(ink_get_topology(), hwloc_topology_get_topology_nodeset(ink_get_topology()), HWLOC_MEMBIND_DEFAULT,
HWLOC_MEMBIND_THREAD);
+#endif
}
hwloc_bitmap_free(nodeset);