Skip to content
guruofquality edited this page Mar 23, 2013 · 5 revisions
  • GRAS provides hooks for setting NUMA node CPU affinity.
  • GRAS provides hooks for setting NUMA node memory affinity.
http://i.imgur.com/WZjUY.png

Implementation details

CPU 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

Memory Affinity

Buffer allocations can be tied to physical memory on a particular NUMA node. There are 3 different ways to do this:

  1. 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

  1. 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

  1. 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

Clone this wiki locally