Skip to content

Commit 566ff66

Browse files
set cpu request=limit when cpubind=true (#334)
1 parent 13064e4 commit 566ff66

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

resources/cpumem/cpumem.go

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ func (cm *cpuMemRequest) Validate() error {
6464
if cm.CPUQuotaRequest > 0 && cm.CPUQuotaLimit > 0 && cm.CPUQuotaRequest > cm.CPUQuotaLimit {
6565
cm.CPUQuotaLimit = cm.CPUQuotaRequest
6666
}
67+
// if CPUBind=true, set cpu request=limit to solve the dilemma
68+
// only deal with cpu limit>request but not vice versa
69+
if cm.CPUBind && cm.CPUQuotaRequest > 0 && cm.CPUQuotaLimit > 0 && cm.CPUQuotaLimit > cm.CPUQuotaRequest {
70+
cm.CPUQuotaRequest = cm.CPUQuotaLimit
71+
}
6772
return nil
6873
}
6974

0 commit comments

Comments
 (0)