-
Notifications
You must be signed in to change notification settings - Fork 111
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
fix(sysadvisor): get util based headroom per-numa #772
base: main
Are you sure you want to change the base?
fix(sysadvisor): get util based headroom per-numa #772
Conversation
ccf04e5
to
50b426d
Compare
fd8aa40
to
3383b49
Compare
@@ -40,11 +41,8 @@ const ( | |||
|
|||
func (ha *HeadroomAssemblerCommon) getUtilBasedHeadroom(options helper.UtilBasedCapacityOptions, |
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.
add a input parameter numaList []int
, such as:
func (ha *HeadroomAssemblerCommon) getUtilBasedHeadroom(options helper.UtilBasedCapacityOptions,
reclaimMetrics *metaserverHelper.ReclaimMetrics,
lastReclaimedCPUPerNuma map[int]float64,
numaList []int,
)
@@ -54,10 +52,14 @@ func (ha *HeadroomAssemblerCommon) getUtilBasedHeadroom(options helper.UtilBased | |||
} | |||
|
|||
util := reclaimMetrics.CgroupCPUUsage / reclaimMetrics.ReclaimedCoresSupply | |||
lastReclaimedCPU := 0.0 |
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.
sum the lastReclaimedCPU
by numaList
, such as:
for _, numaID := range numaList {
lastReclaimedCPU += lastReclaimedCPUPerNuma[numaID]
}
headroom, err := ha.getUtilBasedHeadroom(options, reclaimMetrics) | ||
lastReclaimedCPUPerNuma := make(map[int]float64) | ||
lastReclaimedCPUPerNuma[numaID] = reclaimedCPUs[numaID] | ||
headroom, err := ha.getUtilBasedHeadroom(options, reclaimMetrics, lastReclaimedCPUPerNuma) |
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.
only input the numaID
as list and all numa reclaimed CPUs reclaimedCPUs
headroom, err := ha.getUtilBasedHeadroom(options, reclaimMetrics, reclaimedCPUs,[]int{numaID})
@@ -201,7 +211,7 @@ func (ha *HeadroomAssemblerCommon) getHeadroomByUtil() (resource.Quantity, map[i | |||
} | |||
|
|||
options.MaxCapacity *= float64(len(nonBindingNumas)) | |||
headroom, err := ha.getUtilBasedHeadroom(options, reclaimMetrics) | |||
headroom, err := ha.getUtilBasedHeadroom(options, reclaimMetrics, lastReclaimedCPUPerNuma) |
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.
here only need use nonBindingNumas
:
headroom, err := ha.getUtilBasedHeadroom(options, reclaimMetrics, reclaimedCPUs, nonBindingNumas)
3383b49
to
cf0a6cf
Compare
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for your reviewer: