Skip to content

Commit

Permalink
scheduler: add log for cpu/mem numaaware allocate (#2293)
Browse files Browse the repository at this point in the history
Signed-off-by: wangjianyu.wjy <[email protected]>
Co-authored-by: wangjianyu.wjy <[email protected]>
  • Loading branch information
ZiMengSheng and wangjianyu.wjy authored Dec 11, 2024
1 parent 053d636 commit 1ffae87
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/scheduler/plugins/nodenumaresource/resource_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package nodenumaresource
import (
"errors"
"fmt"
"reflect"
"sort"
"sync"

Expand Down Expand Up @@ -201,6 +202,7 @@ func (c *resourceManager) Allocate(node *corev1.Node, pod *corev1.Pod, options *
if options.hint.NUMANodeAffinity != nil {
resources, err := c.allocateResourcesByHint(node, pod, options)
if err != nil {
klog.Errorf("allocateResourcesByHint for pod %s on node %s, failed: %v", util.GetNamespacedName(pod.Namespace, pod.Name), node.Name, err)
return nil, err
}
if len(resources) == 0 {
Expand All @@ -226,7 +228,9 @@ func (c *resourceManager) allocateResourcesByHint(node *corev1.Node, pod *corev1
if len(options.topologyOptions.NUMANodeResources) == 0 {
return nil, framework.NewStatus(framework.UnschedulableAndUnresolvable, "insufficient resources on NUMA Node")
}

if klog.V(6).Enabled() {
logStruct(reflect.ValueOf(options), fmt.Sprintf("options for pod pod %s/%s on node %s", pod.Namespace, pod.Name, node.Name), 6)
}
totalAvailable := options.requiredResources
if len(totalAvailable) == 0 {
var err error
Expand Down

0 comments on commit 1ffae87

Please sign in to comment.