@@ -49,7 +49,8 @@ type CapperProber interface {
49
49
// evictFirstStrategy always attempts to evict low priority pods if any; only after all are exhausted will it resort to DVFS means.
50
50
// besides, it will continue to try the best to meet the alert spec, regardless of the alert update time.
51
51
// alert level has the following meanings in this strategy:
52
- // P1 - eviction only;
52
+ // P2 - noop and expecting scheduler to bias against the node
53
+ // P1 - noop and expecting scheduler not to schedule to the node
53
54
// P0 - evict if applicable; otherwise conduct DVFS once if needed (DVFS is limited to 10%);
54
55
// S0 - DVFS in urgency (no limit on DVFS)
55
56
type evictFirstStrategy struct {
@@ -95,16 +96,17 @@ func (e *evictFirstStrategy) recommendEvictFirstOp() spec.InternalOp {
95
96
96
97
func (e * evictFirstStrategy ) recommendOp (alert spec.PowerAlert , internalOp spec.InternalOp ) spec.InternalOp {
97
98
if internalOp != spec .InternalOpAuto {
98
- return internalOp
99
+ // internal op is only applicable to dvfs related levels, i.e. s0 + p0
100
+ if alert == spec .PowerAlertS0 || alert == spec .PowerAlertP0 {
101
+ return internalOp
102
+ }
99
103
}
100
104
101
105
switch alert {
102
106
case spec .PowerAlertS0 :
103
107
return spec .InternalOpFreqCap
104
108
case spec .PowerAlertP0 :
105
109
return e .recommendEvictFirstOp ()
106
- case spec .PowerAlertP1 :
107
- return spec .InternalOpEvict
108
110
default :
109
111
return spec .InternalOpNoop
110
112
}
@@ -126,8 +128,8 @@ func (e *evictFirstStrategy) adjustTargetForConstraintDVFS(actualWatt, desiredWa
126
128
func (e * evictFirstStrategy ) yieldActionPlan (op , internalOp spec.InternalOp , actualWatt , desiredWatt int , alert spec.PowerAlert , ttl time.Duration ) action.PowerAction {
127
129
switch op {
128
130
case spec .InternalOpFreqCap :
129
- // try to conduct freq capping within the allowed limit if not set for hard dvfs
130
- if internalOp != spec .InternalOpFreqCap && ! ( alert == spec . PowerAlertS0 && internalOp == spec . InternalOpAuto ) {
131
+ // try to conduct freq capping within the allowed limit except for the unconstrained dvfs
132
+ if alert != spec .PowerAlertS0 {
131
133
var err error
132
134
desiredWatt , err = e .adjustTargetForConstraintDVFS (actualWatt , desiredWatt )
133
135
if err != nil {
0 commit comments