Documentation ¶
Index ¶
- Constants
- func AllocAssign(coreArray []int) (classID int, err error)
- func AllocL3Cache(l3ValuesToSet L3CacheStruct) error
- func AllocateCLOS(res *resctrl.ResAssociation, name string)
- func AssocCore(coresStruct AssocCoresStruct) error
- func AssocTask(tasksStruct AssocTasksStruct) error
- func CheckMBA() (mbaMode int, err error)
- func CoreMaskToSlice(mask string) ([]int, error)
- func DeallocateCores(cores []string) error
- func DeallocateTasks(tasks []string) error
- func Finish() error
- func GetAvailableCLOSes() []string
- func GetNumOfCLOSes(cache, mba bool) (int, error)
- func GetNumOfCacheways() int
- func GetNumOfSockets() int
- func GetNumberOfFreeCLOSes() int
- func GetSharedCLOS() (string, error)
- func GetUsedCLOSes() []string
- func Init() error
- func InitCLOSPool() error
- func IsSharedCLOS(name string) bool
- func MarkCLOSasUsed(name string) error
- func ReleaseAllocatedCores(coreArray []int) error
- func ResetAPI(mode MBAMode) error
- func ResetCOSParamsToDefaults(cosName string) error
- func ReturnClos(name string) error
- func SetMbaForSingleCos(mbaValuesToSet MbaStruct) error
- func UseAvailableCLOS() (string, error)
- type AssocCoresStruct
- type AssocTasksStruct
- type L3CacheStruct
- type MBAMode
- type MbaStruct
Constants ¶
const ( // OSGroupCOS OSGroupCOS = "." // InfraGoupCOS InfraGoupCOS = "COS1" )
names of COSes reserved for special purposes OSGroup is defined as "." instead of "COS0" as some functions are based on filesystem path
Variables ¶
This section is empty.
Functions ¶
func AllocAssign ¶
AllocAssign assigns first available COS to cores in core_array
coreArray list of core ids numOfCores number of core ids in the core_array classID place to store reserved COS id err operation status (nil or error)
func AllocL3Cache ¶
func AllocL3Cache(l3ValuesToSet L3CacheStruct) error
AllocL3Cache allocates L3 Cache for common COS# l3ValuesToSet - contains values needed to set L3 values Function returns operation status (nil or error)
func AssocCore ¶
func AssocCore(coresStruct AssocCoresStruct) error
AssocCore associates core coresStruct - contains values needed to associate core Function returns operation status (nil or error)
func AssocTask ¶
func AssocTask(tasksStruct AssocTasksStruct) error
AssocTask associates pid/task tasksStruct - contains values needed to associate task/pid Function returns operation status (nil or error)
func CheckMBA ¶
CheckMBA checks if MBA is supported PQOS must be initialized before using this function to avoid error mbaMode values:
-1 means that MBA is not supported 0 means that MBA is enabled in percentage mode 1 means that MBA is enabled in MBps mode
func CoreMaskToSlice ¶
CoreMaskToSlice converts bitmasks into cores array
func GetAvailableCLOSes ¶
func GetAvailableCLOSes() []string
GetAvailableCLOSes returns list of CLOSes (copy of original) available for use
func GetNumOfCLOSes ¶
GetNumOfCLOSes returns number of Class Of Services supported by platform Function params (cache and mba) allows to select whether function shall check number of CLOSes for L3 Cache Allocation, Memory Bandwidth Allocation or both (minimum of two values are then returned)
func GetNumOfCacheways ¶
func GetNumOfCacheways() int
GetNumOfCacheways returns amount of cacheways for current machine which is a global variable for PQoS package
func GetNumOfSockets ¶
func GetNumOfSockets() int
GetNumOfSockets returns amount of sockets for current machine which is a global variable for PQoS package
func GetNumberOfFreeCLOSes ¶
func GetNumberOfFreeCLOSes() int
GetNumberOfFreeCLOSes returns number of CLOS that are available to use
func GetSharedCLOS ¶
GetSharedCLOS returns name assigned to shared workloads COS. If shared COS have not been reserved yet function tries to reserve it
func GetUsedCLOSes ¶
func GetUsedCLOSes() []string
GetUsedCLOSes returns list of CLOSes already in use (except reserved CLOSes)
func InitCLOSPool ¶
func InitCLOSPool() error
InitCLOSPool initializes pool of available CLOSes based on number of CLOSes supported by the platform
func IsSharedCLOS ¶
IsSharedCLOS returns true if given CLOS name is reserved for shared workloads, false otherwise
func MarkCLOSasUsed ¶
MarkCLOSasUsed moves given CLOS name from available CLOSes to used CLOSes Used if for some reason (ex. check workload initialization) specific CLOS is in use but not fetched using pqos package API
func ReleaseAllocatedCores ¶
ReleaseAllocatedCores reassign cores in coreArray to default COS#0
please be aware that function will not reset COS params to default values because releasing core from COS is enough * [in] coreArray list of core ids * [in] numOfCores number of core ids in the core_array
func ResetCOSParamsToDefaults ¶
ResetCOSParamsToDefaults resets L3 cache and MBA to default values for specified COS#
func ReturnClos ¶
ReturnClos moves CLOS with given name from used list into available list
func SetMbaForSingleCos ¶
SetMbaForSingleCos sets classes of service defined by mba on mba id for common COS# mbaValuesToSet - contains values needed to set MBA values Function returns operation status (nil or error)
func UseAvailableCLOS ¶
UseAvailableCLOS takes one CLOS name from list of available ones, moves it to used CLOSes and returns it's name If no available CLOS found then empty name and non-nil error is returned
Types ¶
type AssocCoresStruct ¶
type AssocCoresStruct struct { ClassID int // common class of service (COS#) Cores []int // cores to associate }
AssocCoresStruct contains values needed to assoc cores for common ClassID
type AssocTasksStruct ¶
type AssocTasksStruct struct { ClassID int // common class of service (COS#) Tasks []int // tasks to associate }
AssocTasksStruct contains values needed to assoc pid/task for common ClassID
type L3CacheStruct ¶
type L3CacheStruct struct { ClassID int // class of service (COS#) WaysMask []uint64 // bit mask for L3 cache ways for all specified sockets SocketsToSet []int // sockets to set }
L3CacheStruct contains values needed to set L3 values amount of elements in WaysMask must be equal amount of SocketsToSet
type MbaStruct ¶
type MbaStruct struct { ClassID int //class of service (COS#) MbaMode int // 0 for percentage mode or 1 for MBps mode MbaMaxes []int // mba values to set on a specified sockets SocketsToSet []int // sockets to set for common ClassID (COS#) }
MbaStruct contains values needed to set MBA values amount of elements in MbaMaxes must be equal amount of SocketsToSet