Skip to content

Commit f68b450

Browse files
committed
topology-aware: fix grant.String() for reserved CPUs.
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
1 parent 0a59eba commit f68b450

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cmd/plugins/topology-aware/policy/resources.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,13 +1280,14 @@ func (cg *grant) String() string {
12801280
if !cg.exclusive.IsEmpty() {
12811281
exclusive = fmt.Sprintf(", exclusive: %s", cg.exclusive)
12821282
}
1283-
if cg.ReservedPortion() > 0 {
1283+
if cg.ReservedPortion() > 0 || (cg.cpuType == cpuReserved && cg.SharedPortion() == 0) {
12841284
reserved = fmt.Sprintf(", reserved: %s (%dm)",
12851285
cg.node.FreeSupply().ReservedCPUs(), cg.ReservedPortion())
1286-
}
1287-
if cg.SharedPortion() > 0 || (isol.IsEmpty() && cg.exclusive.IsEmpty()) {
1288-
shared = fmt.Sprintf(", shared: %s (%dm)",
1289-
cg.node.FreeSupply().SharableCPUs(), cg.SharedPortion())
1286+
} else {
1287+
if cg.SharedPortion() > 0 || (isol.IsEmpty() && cg.exclusive.IsEmpty()) {
1288+
shared = fmt.Sprintf(", shared: %s (%dm)",
1289+
cg.node.FreeSupply().SharableCPUs(), cg.SharedPortion())
1290+
}
12901291
}
12911292

12921293
mem := fmt.Sprintf(", memory: %s (%s)", cg.memZone, prettyMem(cg.memSize))

0 commit comments

Comments
 (0)