Documentation ¶
Index ¶
- Constants
- Variables
- func CgroupScope(allocID, task string) string
- func FindCgroupMountpointDir() (string, error)
- func GetCPUsFromCgroup(string) ([]uint16, error)
- func GetCgroupParent(string) string
- func SplitPath(p string) (string, string)
- type CgroupPathGetter
- type CpusetManager
- type NoopCpusetManager
- type TaskCgroupInfo
Constants ¶
View Source
const ( // CgroupRoot is hard-coded in the cgroups specification. // It only applies to linux but helpers have references to it in driver(s). CgroupRoot = "/sys/fs/cgroup" )
View Source
const (
// DefaultCgroupParent does not apply to non-Linux operating systems.
DefaultCgroupParent = ""
)
Variables ¶
View Source
var UseV2 = false
UseV2 is always false on non-Linux systems.
This is a read-only value.
Functions ¶
func CgroupScope ¶ added in v1.3.0
CgroupScope returns nothing for non-Linux operating systems.
func FindCgroupMountpointDir ¶
FindCgroupMountpointDir returns nothing for non-Linux operating systems.
func GetCPUsFromCgroup ¶ added in v1.3.0
GetCPUsFromCgroup returns nothing for non-Linux operating systems.
func GetCgroupParent ¶ added in v1.3.0
GetCgroupParent returns nothing for non-Linux operating systems.
Types ¶
type CgroupPathGetter ¶
CgroupPathGetter is a function which returns the cgroup path and any error which occurred during cgroup initialization.
It should block until the cgroup has been created or an error is reported.
type CpusetManager ¶
type CpusetManager interface { // Init should be called with the initial set of reservable cores before any // allocations are managed. Ensures the parent cgroup exists and proper permissions // are available for managing cgroups. Init([]uint16) error // AddAlloc adds an allocation to the manager AddAlloc(alloc *structs.Allocation) // RemoveAlloc removes an alloc by ID from the manager RemoveAlloc(allocID string) // CgroupPathFor returns a callback for getting the cgroup path and any error that may have occurred during // cgroup initialization. The callback will block if the cgroup has not been created CgroupPathFor(allocID, taskName string) CgroupPathGetter }
CpusetManager is used to setup cpuset cgroups for each task.
func CreateCPUSetManager ¶ added in v1.3.0
func CreateCPUSetManager(string, hclog.Logger) CpusetManager
CreateCPUSetManager creates a no-op CpusetManager for non-Linux operating systems.
type NoopCpusetManager ¶
type NoopCpusetManager struct{}
func (NoopCpusetManager) AddAlloc ¶ added in v1.3.0
func (n NoopCpusetManager) AddAlloc(alloc *structs.Allocation)
func (NoopCpusetManager) CgroupPathFor ¶ added in v1.3.0
func (n NoopCpusetManager) CgroupPathFor(allocID, task string) CgroupPathGetter
func (NoopCpusetManager) Init ¶ added in v1.3.0
func (n NoopCpusetManager) Init([]uint16) error
func (NoopCpusetManager) RemoveAlloc ¶ added in v1.3.0
func (n NoopCpusetManager) RemoveAlloc(allocID string)
Click to show internal directories.
Click to hide internal directories.