Add more extensive testing for NUMA distribution algorithm in CPUManager

Signed-off-by: Kevin Klues <kklues@nvidia.com>
This commit is contained in:
Kevin Klues 2021-10-14 11:40:09 +00:00
parent cf3afb8602
commit 1436e33642

View File

@ -685,6 +685,70 @@ func TestTakeByTopologyNUMADistributed(t *testing.T) {
"",
mustParseCPUSet(t, "0-7,10-17,20-27,30-37,40-47,50-57,60-67,70-77"),
},
{
"allocate 24 full cores with 8 distributed across the first 3 NUMA nodes",
topoDualSocketMultiNumaPerSocketHT,
mustParseCPUSet(t, "0-79"),
48,
"",
mustParseCPUSet(t, "0-7,10-17,20-27,40-47,50-57,60-67"),
},
{
"allocate 24 full cores with 8 distributed across the first 3 NUMA nodes (filling the first NUMA node)",
topoDualSocketMultiNumaPerSocketHT,
mustParseCPUSet(t, "2-39,42-79"),
48,
"",
mustParseCPUSet(t, "2-9,10-17,20-27,42-49,50-57,60-67"),
},
{
"allocate 24 full cores with 8 distributed across the last 3 NUMA nodes (no room on the first NUMA node to distribute)",
topoDualSocketMultiNumaPerSocketHT,
mustParseCPUSet(t, "3-39,43-79"),
48,
"",
mustParseCPUSet(t, "10-17,20-27,30-37,50-57,60-67,70-77"),
},
{
"allocate 8 full cores with 2 distributed across each NUMA node",
topoDualSocketMultiNumaPerSocketHT,
mustParseCPUSet(t, "0-2,10-12,20-22,30-32,40-41,50-51,60-61,70-71"),
16,
"",
mustParseCPUSet(t, "0-1,10-11,20-21,30-31,40-41,50-51,60-61,70-71"),
},
{
"allocate 8 full cores with 2 distributed across each NUMA node",
topoDualSocketMultiNumaPerSocketHT,
mustParseCPUSet(t, "0-2,10-12,20-22,30-32,40-41,50-51,60-61,70-71"),
16,
"",
mustParseCPUSet(t, "0-1,10-11,20-21,30-31,40-41,50-51,60-61,70-71"),
},
{
"allocate 13 full cores distributed across the first 2 NUMA nodes",
topoDualSocketMultiNumaPerSocketHT,
mustParseCPUSet(t, "0-79"),
26,
"",
mustParseCPUSet(t, "0-6,10-16,40-45,50-55"),
},
{
"allocate 31 full cores with 15 CPUs distributed across each NUMA node and 1 CPU spilling over to each of NUMA 0, 1",
topoDualSocketMultiNumaPerSocketHT,
mustParseCPUSet(t, "0-79"),
62,
"",
mustParseCPUSet(t, "0-7,10-17,20-27,30-37,40-47,50-57,60-66,70-76"),
},
{
"allocate 31 full cores with 15 CPUs distributed across each NUMA node and 1 CPU spilling over to each of NUMA 2, 3 (to keep balance)",
topoDualSocketMultiNumaPerSocketHT,
mustParseCPUSet(t, "0-8,10-18,20-39,40-48,50-58,60-79"),
62,
"",
mustParseCPUSet(t, "0-7,10-17,20-27,30-37,40-46,50-56,60-67,70-77"),
},
}...)
for _, tc := range testCases {