Skip to content

Commit

Permalink
refine the condition of numa memory pressure
Browse files Browse the repository at this point in the history
  • Loading branch information
LuyaoZhong committed Mar 6, 2024
1 parent 9e1aa76 commit 4acb9a2
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
"strconv"
"time"

"github.com/alecthomas/units"

v1 "k8s.io/api/core/v1"
"k8s.io/client-go/tools/events"

Expand Down Expand Up @@ -141,9 +143,10 @@ func (m *EnhancedNumaMemoryPressurePlugin) detectNumaPressures() {
"free: %+v, total: %+v, scaleFactor: %+v, inactiveFile: %+v, numaKswapdStealDelta: %+v",
numaID, numaFree, numaTotal, scaleFactor, numaInactiveFile.Value, 0)

m.numaPressureStatMap[numaID] = numaFree + numaInactiveFile.Value - 2*numaTotal*scaleFactor/10000
threshhold := general.Clamp(float64(10*units.GiB), 2*numaTotal*scaleFactor/10000, float64((25 * units.GiB)))

Check failure on line 146 in pkg/agent/evictionmanager/plugin/memory/enhanced_numa_pressure.go

View workflow job for this annotation

GitHub Actions / Lint

`threshhold` is a misspelling of `threshold` (misspell)
m.numaPressureStatMap[numaID] = numaFree + numaInactiveFile.Value - threshhold

Check failure on line 147 in pkg/agent/evictionmanager/plugin/memory/enhanced_numa_pressure.go

View workflow job for this annotation

GitHub Actions / Lint

`threshhold` is a misspelling of `threshold` (misspell)
// TODO: use numa kswapd steal to detect numa pressure instead of system kswapd steal
if numaFree+numaInactiveFile.Value <= 2*numaTotal*scaleFactor/10000 && systemKswapdSteal.Value-m.systemKswapdStealLastCycle > 0 {
if m.numaPressureStatMap[numaID] <= 0 && systemKswapdSteal.Value-m.systemKswapdStealLastCycle > 0 {
m.isUnderNumaPressure = true
m.numaActionMap[numaID] = actionEviction
_ = m.emitter.StoreInt64(metricsNameThresholdMet, 1, metrics.MetricTypeNameCount,
Expand Down

0 comments on commit 4acb9a2

Please sign in to comment.