Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions iocore/aio/AIO.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,13 @@ 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;
Expand Down
9 changes: 9 additions & 0 deletions iocore/eventsystem/UnixEventProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,25 @@ 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
stack = this->alloc_hugepage_stack(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);
Expand Down