pqos

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2021 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
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

func AllocAssign(coreArray []int) (classID int, err error)

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 AllocateCLOS

func AllocateCLOS(res *resctrl.ResAssociation, name string)

AllocateCLOS ...

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

func CheckMBA() (mbaMode int, err error)

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

func CoreMaskToSlice(mask string) ([]int, error)

CoreMaskToSlice converts bitmasks into cores array

func DeallocateCores

func DeallocateCores(cores []string) error

DeallocateCores ...

func DeallocateTasks

func DeallocateTasks(tasks []string) error

DeallocateTasks ...

func Finish

func Finish() error

Finish shuts down PQoS module

func GetAvailableCLOSes

func GetAvailableCLOSes() []string

GetAvailableCLOSes returns list of CLOSes (copy of original) available for use

func GetNumOfCLOSes

func GetNumOfCLOSes(cache, mba bool) (int, error)

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

func GetSharedCLOS() (string, error)

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 Init

func Init() error

Init ...

func InitCLOSPool

func InitCLOSPool() error

InitCLOSPool initializes pool of available CLOSes based on number of CLOSes supported by the platform

func IsSharedCLOS

func IsSharedCLOS(name string) bool

IsSharedCLOS returns true if given CLOS name is reserved for shared workloads, false otherwise

func MarkCLOSasUsed

func MarkCLOSasUsed(name string) error

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

func ReleaseAllocatedCores(coreArray []int) error

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 ResetAPI

func ResetAPI(mode MBAMode) error

ResetAPI resets configuration of allocation technologies

func ResetCOSParamsToDefaults

func ResetCOSParamsToDefaults(cosName string) error

ResetCOSParamsToDefaults resets L3 cache and MBA to default values for specified COS#

func ReturnClos

func ReturnClos(name string) error

ReturnClos moves CLOS with given name from used list into available list

func SetMbaForSingleCos

func SetMbaForSingleCos(mbaValuesToSet MbaStruct) error

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

func UseAvailableCLOS() (string, error)

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 MBAMode

type MBAMode int

MBAMode describes selected MBA (Memory Bandwidth Allocation) mode

const (
	// MBANone means MBA not used by RMD so not needed
	MBANone MBAMode = iota
	// MBAPercentage means MBA in percentage (default) mode is used
	MBAPercentage
	// MBAMbps means MBA in Mbps mode is used
	MBAMbps
)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL