intel / cri-resource-manager

Kubernetes Container Runtime Interface proxy service with hardware resource aware workload placement policies
Apache License 2.0
170 stars 56 forks source link

cpuallocator: improve allocation heuristics #191

Open marquiz opened 4 years ago

marquiz commented 4 years ago

Bring more NUMA-awareness to the cpuallocator (implemented in pkg/cpuallocator/). Discussing/reviewing the cpu allocation logic with @klihub we realized that the allocator is too simple, resulting in clearly non-optimal results. This concerns especially takeIdleCores() which should (we think) try to more aggressively and intelligently pack workloads in topology-aware manner.

The cpuallocator would need to be improved with additional tightest-fit allocation rules beyond the current topology socket/core/thread hierarchy to get to a more realistic socket/die/NUMA node/core/thread hierachy:

klihub commented 3 years ago

It should also do these things, too.

It would also need to be improved with additional tightest-fit allocation rules
beyond the current topology socket/core/thread hierarchy to get to a more
realistic socket/die/NUMA node/core/thread hierachy:
  - try allocating a full die if the number of requested cpus matches exactly
  - try allocating a full NUMA node if the number of cpus matches exactly
  - only then give up and try allocating mere full cores or threads, and also with these
    - try taking sub-NUMA node number of cores/threads from a single NUMA node,
    - try taking sub-die number of cores/threads from a single die
marquiz commented 3 years ago

It should also do these things, too

I added these to the issue description

marquiz commented 3 years ago

Had a brainstorming session with @klihub . I think we have an agreement that a full rewrite would be the right thing to do. Some ideas we came up with: