-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modify numa-aware memory headroom policy to consider about inactive pages #383
Conversation
d9ae790
to
3a6c85b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #383 +/- ##
==========================================
- Coverage 53.78% 53.57% -0.22%
==========================================
Files 446 446
Lines 49411 49422 +11
==========================================
- Hits 26578 26478 -100
- Misses 19830 19943 +113
+ Partials 3003 3001 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
pls make the commit message more meaningful to let others know exactly what you wan to modify |
3a6c85b
to
bed462b
Compare
@@ -121,6 +122,14 @@ func (p *PolicyNUMAAware) Update() (err error) { | |||
reclaimableMemory += data.Value | |||
general.InfoS("reclaimable numa memory free", "numaID", numaID, "numaFree", general.FormatMemoryQuantity(data.Value)) | |||
|
|||
data, err = p.metaServer.GetNumaMetric(numaID, consts.MetricMemInactiveFileNuma) | |||
if err != nil { | |||
general.InfoS("failed to get numa inactive file", "numaID", numaID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not return error here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inactive file is kind of buffer, we can return headroom without buffer, return error seems a overkill here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the loss of this metric is accidental,headroom may change abruptly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, it makes sense.
@@ -22,6 +22,8 @@ import ( | |||
"testing" | |||
"time" | |||
|
|||
"github.com/kubewharf/katalyst-core/pkg/config/agent/dynamic/adminqos/reclaimedresource/memoryheadroom" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code style: sort goimports by 3 groups: std, general, project dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
33d2600
to
91b6bc8
Compare
Numa-aware memory headroom was calculated by reclaimable numa free - 2 * watermark_reserved - config_reserved + reclaimed-core requests Double watermark reservation reserved the memory too much. Besides, portion of inactive file should be considered as cold pages on the system, which could be charged to memory headroom since it's easy to be reclaimed by kernel reclaim mechanism. Therefore, numa-ware memory headroom will be calculated by reclaimable numa free - watermark_reserved - config_reserved + cacheBasedRatio * numaInactiveFile + reclaimed-core requests
91b6bc8
to
9439d07
Compare
130a9cc
Numa-aware memory headroom was calculated by
Double watermark reservation reserved the memory too much. Besides, portion of inactive file should be
considered as cold pages on the system, which could be charged to memory headroom since it's easy to
be reclaimed by kernel reclaim mechanism.
Therefore, numa-ware memory headroom will be calculated by