Skip to content

Commit

Permalink
Merge pull request #49 from y-ykcir/oom_priority
Browse files Browse the repository at this point in the history
feat(qrm): Support for OOM priority as a QoS enhancement
  • Loading branch information
waynepeking348 authored Nov 21, 2023
2 parents a58ac43 + e85409d commit d7149d6
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/consts/qos.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,22 @@ const (
// - this enhancement is only supported for dedicated-cores, for now and foreseeable future
PodAnnotationMemoryEnhancementNumaExclusive = "numa_exclusive"
PodAnnotationMemoryEnhancementNumaExclusiveEnable = "true"

// PodAnnotationMemoryEnhancementOOMPriority provides a mechanism to specify
// the OOM priority for pods. Higher priority values indicate a higher likelihood
// of surviving OOM events.
//
// For different QoS levels, the acceptable value ranges are as follows:
// - reclaimed_cores: [-100, 0)
// - shared_cores: [0, 100)
// - dedicated_cores: [100, 200)
// - system_cores: [200, 300)
// Additionally, there are two predefined values for any pod:
// - -300: Indicates that the OOM priority is ignored, and the pod does not
// participate in priority comparison.
// - 300: Indicates that the OOM priority is set to the highest level, the pod
// will never be terminated due to OOM events from the perspective of OOM enhancement
PodAnnotationMemoryEnhancementOOMPriority = "oom_priority"
)

// const variables for pod annotations about qos level enhancement in cpu
Expand Down
31 changes: 31 additions & 0 deletions pkg/consts/qrm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
Copyright 2022 The Katalyst Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package consts

// QRMPhase is the phase of each rpc call in qrm plugin
type QRMPhase int

const (
QRMPhaseGetTopologyHints QRMPhase = iota
QRMPhaseRemovePod
QRMPhaseGetResourcesAllocation
QRMPhaseGetTopologyAwareResources
QRMPhaseGetTopologyAwareAllocatableResources
QRMPhaseGetResourcePluginOptions
QRMPhaseAllocate
QRMPhasePreStartContainer
)

0 comments on commit d7149d6

Please sign in to comment.