Skip to content

Commit

Permalink
chore(qrm): support migrate pages in handleAdvisorCPUSetMems
Browse files Browse the repository at this point in the history
  • Loading branch information
luomingmeng committed Dec 3, 2024
1 parent 76e6c12 commit 77d8b59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/agent/qrm-plugins/memory/dynamicpolicy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func NewDynamicPolicy(agentCtx *agent.GenericContext, conf *config.Configuration
memoryadvisor.RegisterControlKnobHandler(memoryadvisor.ControlKnobKeyMemoryLimitInBytes,
memoryadvisor.ControlKnobHandlerWithChecker(policyImplement.handleAdvisorMemoryLimitInBytes))
memoryadvisor.RegisterControlKnobHandler(memoryadvisor.ControlKnobKeyCPUSetMems,
memoryadvisor.ControlKnobHandlerWithChecker(handleAdvisorCPUSetMems))
memoryadvisor.ControlKnobHandlerWithChecker(policyImplement.handleAdvisorCPUSetMems))
memoryadvisor.RegisterControlKnobHandler(memoryadvisor.ControlKnobKeyDropCache,
memoryadvisor.ControlKnobHandlerWithChecker(policyImplement.handleAdvisorDropCache))
memoryadvisor.RegisterControlKnobHandler(memoryadvisor.ControlKnobReclaimedMemorySize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func (p *DynamicPolicy) pushMemoryAdvisor() error {
return nil
}

func handleAdvisorCPUSetMems(
func (p *DynamicPolicy) handleAdvisorCPUSetMems(
_ *config.Configuration,
_ interface{},
_ *dynamicconfig.DynamicAgentConfiguration,
Expand Down Expand Up @@ -411,8 +411,12 @@ func handleAdvisorCPUSetMems(
apiconsts.PodAnnotationQoSLevelReclaimedCores)
}

allocationInfo.NumaAllocationResult = cpusetMems
allocationInfo.TopologyAwareAllocations = nil
numaSetChangedContainers := make(map[string]map[string]*state.AllocationInfo)
p.updateNUMASetChangedContainers(numaSetChangedContainers, allocationInfo, cpusetMems)
err = p.migratePagesForNUMASetChangedContainers(numaSetChangedContainers)
if err != nil {
return fmt.Errorf("migratePagesForNUMASetChangedContainers failed with error: %v", err)
}

_ = emitter.StoreInt64(util.MetricNameMemoryHandleAdvisorCPUSetMems, 1,
metrics.MetricTypeNameRaw, metrics.ConvertMapToTags(map[string]string{
Expand Down

0 comments on commit 77d8b59

Please sign in to comment.