mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Merge pull request #83777 from lmdaly/fix-single-numa-node-with-best-effort-pods
Fixed bug in TopologyManager with SingleNUMANode Policy
This commit is contained in:
commit
002dbf6a4c
@ -37,7 +37,7 @@ func (p *singleNumaNodePolicy) Name() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *singleNumaNodePolicy) CanAdmitPodResult(hint *TopologyHint) lifecycle.PodAdmitResult {
|
func (p *singleNumaNodePolicy) CanAdmitPodResult(hint *TopologyHint) lifecycle.PodAdmitResult {
|
||||||
if !hint.Preferred || hint.NUMANodeAffinity.Count() > 1 {
|
if !hint.Preferred {
|
||||||
return lifecycle.PodAdmitResult{
|
return lifecycle.PodAdmitResult{
|
||||||
Admit: false,
|
Admit: false,
|
||||||
Reason: "Topology Affinity Error",
|
Reason: "Topology Affinity Error",
|
||||||
|
@ -31,16 +31,6 @@ func TestPolicySingleNumaNodeCanAdmitPodResult(t *testing.T) {
|
|||||||
hint: TopologyHint{nil, false},
|
hint: TopologyHint{nil, false},
|
||||||
expected: false,
|
expected: false,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "NUMANodeAffinity has multiple NUMA Nodes masked in topology hints",
|
|
||||||
hint: TopologyHint{NewTestBitMask(0, 1), true},
|
|
||||||
expected: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "NUMANodeAffinity has one NUMA Node masked in topology hints",
|
|
||||||
hint: TopologyHint{NewTestBitMask(0), true},
|
|
||||||
expected: true,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range tcases {
|
for _, tc := range tcases {
|
||||||
|
@ -857,6 +857,24 @@ func TestAdmit(t *testing.T) {
|
|||||||
hp: []HintProvider{},
|
hp: []HintProvider{},
|
||||||
expected: true,
|
expected: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "QOSClass set as BestEffort. single-numa-node Policy. No Hints.",
|
||||||
|
qosClass: v1.PodQOSBestEffort,
|
||||||
|
policy: NewRestrictedPolicy(),
|
||||||
|
hp: []HintProvider{
|
||||||
|
&mockHintProvider{},
|
||||||
|
},
|
||||||
|
expected: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "QOSClass set as BestEffort. Restricted Policy. No Hints.",
|
||||||
|
qosClass: v1.PodQOSBestEffort,
|
||||||
|
policy: NewRestrictedPolicy(),
|
||||||
|
hp: []HintProvider{
|
||||||
|
&mockHintProvider{},
|
||||||
|
},
|
||||||
|
expected: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "QOSClass set as Guaranteed. BestEffort Policy. Preferred Affinity.",
|
name: "QOSClass set as Guaranteed. BestEffort Policy. Preferred Affinity.",
|
||||||
qosClass: v1.PodQOSGuaranteed,
|
qosClass: v1.PodQOSGuaranteed,
|
||||||
|
Loading…
Reference in New Issue
Block a user