Skip to content

Commit

Permalink
koordlet: support hugepage reporting (#1744)
Browse files Browse the repository at this point in the history
Signed-off-by: peiqiao.wpq <[email protected]>
Co-authored-by: peiqiao.wpq <[email protected]>
  • Loading branch information
peiqiaoWang and peiqiao.wpq authored Dec 14, 2023
1 parent c927e11 commit c9d5286
Show file tree
Hide file tree
Showing 8 changed files with 1,607 additions and 75 deletions.
9 changes: 9 additions & 0 deletions pkg/features/koordlet_features.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ const (
//
// ColdPageCollector enables coldPageCollector feature of koordlet.
ColdPageCollector featuregate.Feature = "ColdPageCollector"

// HugePageReport enables hugepage collector feature of koordlet.
// This feature supports reporting of hugepages.
// The koord-scheduler will allocate hugepage information based on the user's hugepage request and add it to the Pod's annotations.
// Format: scheduling.koordinator.sh/resource-status: '{"numaNodeResources":[{"node":1,"resources":{"hugepages-1Gi":"50Gi"}}]}'.
// Backend applications can enable the hugepages based on the allocation results.
// For example, the CSI mounts the pre-allocated hugepages into the pod.
HugePageReport featuregate.Feature = "HugePageReport"
)

func init() {
Expand Down Expand Up @@ -161,6 +169,7 @@ var (
PSICollector: {Default: false, PreRelease: featuregate.Alpha},
BlkIOReconcile: {Default: false, PreRelease: featuregate.Alpha},
ColdPageCollector: {Default: false, PreRelease: featuregate.Alpha},
HugePageReport: {Default: false, PreRelease: featuregate.Alpha},
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/klog/v2"

"github.com/koordinator-sh/koordinator/pkg/features"
"github.com/koordinator-sh/koordinator/pkg/koordlet/metriccache"
"github.com/koordinator-sh/koordinator/pkg/koordlet/metrics"
"github.com/koordinator-sh/koordinator/pkg/koordlet/metricsadvisor/framework"
Expand Down Expand Up @@ -111,6 +112,9 @@ func (n *nodeInfoCollector) collectNodeNUMAInfo() error {
metrics.RecordCollectNodeNUMAInfoStatus(err)
return err
}
if features.DefaultKoordletFeatureGate.Enabled(features.HugePageReport) {
koordletutil.GetAndMergeHugepageToNumaInfo(nodeNUMAInfo)
}
klog.V(6).Infof("collect NUMA info successfully, info %+v", nodeNUMAInfo)

n.storage.Set(metriccache.NodeNUMAInfoKey, nodeNUMAInfo)
Expand Down
Loading

0 comments on commit c9d5286

Please sign in to comment.