Documentation ¶
Index ¶
- Constants
- Variables
- func Commit(r *ResAssociation, group string) error
- func CommitAll(mRes map[string]*ResAssociation) error
- func DestroyResAssociation(group string) error
- func DisableRdt() bool
- func EnableCat() bool
- func EnableCdp() bool
- func GetRdtCosInfo() map[string]*RdtCosInfo
- func GetResAssociation() map[string]*ResAssociation
- func IsIntelRdtMounted() bool
- func IsNotFound(err error) bool
- func NewNotFoundError(res string) error
- func RemoveTasks(tasks []string) error
- type CPUsTask
- type CacheCos
- type GroupTask
- type NotFoundError
- type RdtCosInfo
- type ResAssociation
- type SchemataTask
- type Task
- type TasksTask
Constants ¶
const (
// SysResctrl is the patch to resctrl
SysResctrl = "/sys/fs/resctrl"
)
Variables ¶
var ( // RdtInfo is global immutable variable RdtInfo *map[string]*RdtCosInfo )
Functions ¶
func Commit ¶
func Commit(r *ResAssociation, group string) error
Commit resources in resctrl FIXME Commit should be a transaction. So we use taskFlow to guarantee the consistency. Also we need a coarse granularity lock for IPC. We already has it. Also we need a file lock for consistency among different processes. In plan. After some test on taskFlow, we can remove these logic code and use taskFlow. The taskFlow need a snapshot of all ResAssociation for the transaction. It can be gotten by GetResAssociation.
func CommitAll ¶
func CommitAll(mRes map[string]*ResAssociation) error
CommitAll change all resource group FIXME need to catch error
func DestroyResAssociation ¶
DestroyResAssociation removes resource group
func GetRdtCosInfo ¶
func GetRdtCosInfo() map[string]*RdtCosInfo
GetRdtCosInfo gives RDT info access the resctrl need flock to avoid race with other agent. Go does not support flock lib. That need cgo, please ref: https://gist.github.com/ericchiang/ce0fdcac5659d0a80b38 now we can use lib/flock/flock.go
func GetResAssociation ¶
func GetResAssociation() map[string]*ResAssociation
GetResAssociation returns all resource groups access the resctrl need flock to avoid race with other agent. Go does not support flock lib. That need cgo, please ref: https://gist.github.com/ericchiang/ce0fdcac5659d0a80b38 now we can use lib/flock/flock.go
func IsIntelRdtMounted ¶
func IsIntelRdtMounted() bool
IsIntelRdtMounted give true/false of RDT mounted or not
func NewNotFoundError ¶
NewNotFoundError returns new error of NotFoundError
func RemoveTasks ¶
RemoveTasks move tasks to default resctrl group Resctrl doesn't support remove tasks from sysfs, the way to remove tasks from resource group is to move them to default group
Types ¶
type GroupTask ¶
type GroupTask struct {
Task
}
GroupTask is task to create new group
type NotFoundError ¶
type NotFoundError struct {
ResourceControl string
}
NotFoundError represents not found error
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type RdtCosInfo ¶
RdtCosInfo is from /sys/fs/resctrl/info
type ResAssociation ¶
ResAssociation is the resource group in resctrl TODO need to paser the tag for field setting.
func NewResAssociation ¶
func NewResAssociation() *ResAssociation
NewResAssociation gives new empty ResAssociation
type Task ¶
type Task struct { TaskName string *ResAssociation RessSnapshot map[string]*ResAssociation Group string Path string Revert bool // whether need to Revert after task faild }
Task is task for resctrl