-
Notifications
You must be signed in to change notification settings - Fork 11
Affinity
- GRAS provides hooks for setting NUMA node CPU affinity.
- GRAS provides hooks for setting NUMA node memory affinity.
Thread pools can be affinitized to a particular NUMA node. An additional CPU mask controls which CPUs within a node can be used.
Affinity is a constructor argument to the thread pool. All threads in the pool will have the same affinity. Affinity cannot be changed at runtime.
See: https://github.com/guruofquality/gras/blob/master/include/gras/thread_pool.hpp
Buffer allocations can be tied to physical memory on a particular NUMA node. There are 3 different ways to do this:
- Global buffer affinity can be set on a per-TopBlock basis.
See GlobalBlockConfig/set_global_config: https://github.com/guruofquality/gras/blob/master/include/gras/top_block.hpp
- Buffer affinity can also be set on a per-Block basis.
See set_buffer_affinity: https://github.com/guruofquality/gras/blob/master/include/gras/block.hpp
- Custom buffer allocators can allocate buffers with the desired affinity.
See input_buffer_allocator/output_buffer_allocator: https://github.com/guruofquality/gras/blob/master/include/gras/block.hpp