Documentation ¶
Index ¶
- Constants
- type CookieCacheEntry
- func (c *CookieCacheEntry) AddPIDs(pids ...uint32)
- func (c *CookieCacheEntry) ContainsPIDs(pids ...uint32) []uint32
- func (c *CookieCacheEntry) DeepCopy() *CookieCacheEntry
- func (c *CookieCacheEntry) DeletePIDs(pids ...uint32)
- func (c *CookieCacheEntry) GetAllPIDs() []uint32
- func (c *CookieCacheEntry) GetCookieID() uint64
- func (c *CookieCacheEntry) HasPID(pid uint32) bool
- func (c *CookieCacheEntry) IsEntryInvalid() bool
- func (c *CookieCacheEntry) SetCookieID(cookieID uint64)
- type PIDCache
- type Param
- type Plugin
- func (p *Plugin) IsCacheInited() bool
- func (p *Plugin) Register(op hooks.Options)
- func (p *Plugin) SetContainerCookie(proto protocol.HooksProtocol) error
- func (p *Plugin) SetKubeQOSCPUIdle(proto protocol.HooksProtocol) error
- func (p *Plugin) Setup(op hooks.Options)
- func (p *Plugin) SystemSupported() bool
- type Rule
Constants ¶
const ( // ExpellerGroupSuffix is the default suffix of the expeller core sched group. ExpellerGroupSuffix = "-expeller" // NoneGroupID is the special ID denoting none core sched group. NoneGroupID = "__0__" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CookieCacheEntry ¶
type CookieCacheEntry struct {
// contains filtered or unexported fields
}
CookieCacheEntry is an entry which stores the cookie ID and its belonging PIDs.
func (*CookieCacheEntry) AddPIDs ¶
func (c *CookieCacheEntry) AddPIDs(pids ...uint32)
func (*CookieCacheEntry) ContainsPIDs ¶
func (c *CookieCacheEntry) ContainsPIDs(pids ...uint32) []uint32
func (*CookieCacheEntry) DeepCopy ¶
func (c *CookieCacheEntry) DeepCopy() *CookieCacheEntry
func (*CookieCacheEntry) DeletePIDs ¶
func (c *CookieCacheEntry) DeletePIDs(pids ...uint32)
func (*CookieCacheEntry) GetAllPIDs ¶
func (c *CookieCacheEntry) GetAllPIDs() []uint32
GetAllPIDs gets all PIDs sorted in ascending order.
func (*CookieCacheEntry) GetCookieID ¶
func (c *CookieCacheEntry) GetCookieID() uint64
func (*CookieCacheEntry) HasPID ¶
func (c *CookieCacheEntry) HasPID(pid uint32) bool
func (*CookieCacheEntry) IsEntryInvalid ¶
func (c *CookieCacheEntry) IsEntryInvalid() bool
func (*CookieCacheEntry) SetCookieID ¶
func (c *CookieCacheEntry) SetCookieID(cookieID uint64)
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is responsible for managing core sched cookies and cpu.idle for containers.
func (*Plugin) IsCacheInited ¶
func (*Plugin) SetContainerCookie ¶
func (p *Plugin) SetContainerCookie(proto protocol.HooksProtocol) error
SetContainerCookie reconciles the core sched cookie for the container. There are the following operations about the cookies:
- Get: Get the cookie for a core sched group, firstly try finding in cache and then get from the existing PIDs.
- Add: Add a new cookie for a core sched group for a container, and add a new entry into the cache.
- Assign: Assign a cookie of an existing core sched group for a container and update the cache entry. The cached sibling PIDs (i.e. the PIDs of the same core sched group) will be fetched in the Assign. If all cookies of the sibling PIDs are default or invalid, the Assign should fall back to Add.
- Clear: Clear a cookie of an existing core sched group for a container (reset to default cookie 0), and the containers' PIDs are removed from the cache. The cache entry of the group is removed when the number of the cached PIDs decreases to zero.
If multiple non-default cookies are assigned to existing containers of the same group, the firstly-created and available cookie will be retained and the PIDs of others will be moved to the former. NOTE: The agent itself should be set the default cookie. It can be excluded by setting QoS to SYSTEM.
func (*Plugin) SetKubeQOSCPUIdle ¶
func (p *Plugin) SetKubeQOSCPUIdle(proto protocol.HooksProtocol) error
func (*Plugin) SystemSupported ¶
type Rule ¶
type Rule struct {
// contains filtered or unexported fields
}
func (*Rule) IsKubeQOSCPUIdle ¶
func (r *Rule) IsKubeQOSCPUIdle(KubeQOS corev1.PodQOSClass) bool
func (*Rule) IsPodEnabled ¶
func (r *Rule) IsPodEnabled(podQoSClass extension.QoSClass, podKubeQOS corev1.PodQOSClass) (bool, bool)
IsPodEnabled returns if the pod's core sched is enabled by the rule, and if the QoS-level core expeller is enabled.