Skip to content

Commit

Permalink
fix(*): fix sysadvisor state reclaim pod's TopologyAwareAssignments i…
Browse files Browse the repository at this point in the history
…s not equal to qrm state
  • Loading branch information
luomingmeng committed Feb 18, 2025
1 parent cdf8732 commit 3ad8c30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ func (p *DynamicPolicy) GetCheckpoint(_ context.Context,

chkEntries[uid].Entries[entryName].OwnerPoolName = ownerPoolName

// not set topology-aware assignments for shared_cores and reclaimed_cores,
// not set topology-aware assignments for shared_cores,
// since their topology-aware assignments are same to the pools they are in.
if (!allocationInfo.CheckShared() && !allocationInfo.CheckReclaimed()) || containerEntries.IsPoolEntry() {
if !allocationInfo.CheckShared() || containerEntries.IsPoolEntry() {
chkEntries[uid].Entries[entryName].TopologyAwareAssignments = machine.ParseCPUAssignmentFormat(allocationInfo.TopologyAwareAssignments)
chkEntries[uid].Entries[entryName].OriginalTopologyAwareAssignments = machine.ParseCPUAssignmentFormat(allocationInfo.OriginalTopologyAwareAssignments)
}
Expand Down Expand Up @@ -274,9 +274,9 @@ func (p *DynamicPolicy) createGetAdviceRequest() (*advisorapi.GetAdviceRequest,

info.AllocationInfo.OwnerPoolName = ownerPoolName

// not set topology-aware assignments for shared_cores and reclaimed_cores,
// not set topology-aware assignments for shared_cores,
// since their topology-aware assignments are same to the pools they are in.
if (!allocationInfo.CheckShared() && !allocationInfo.CheckReclaimed()) || containerEntries.IsPoolEntry() {
if !allocationInfo.CheckShared() || containerEntries.IsPoolEntry() {
info.AllocationInfo.TopologyAwareAssignments = machine.ParseCPUAssignmentFormat(allocationInfo.TopologyAwareAssignments)
info.AllocationInfo.OriginalTopologyAwareAssignments = machine.ParseCPUAssignmentFormat(allocationInfo.OriginalTopologyAwareAssignments)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/sysadvisor/plugin/qosaware/server/cpu_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ func (cs *cpuServer) setContainerInfoBasedOnAllocationInfo(
}

// fill in topology aware assignment for containers with owner pool
if ci.QoSLevel != consts.PodAnnotationQoSLevelDedicatedCores {
if info.TopologyAwareAssignments == nil {
if len(ci.OwnerPoolName) > 0 {
if poolInfo, ok := cs.metaCache.GetPoolInfo(ci.OwnerPoolName); ok {
ci.TopologyAwareAssignments = poolInfo.TopologyAwareAssignments.Clone()
Expand Down

0 comments on commit 3ad8c30

Please sign in to comment.