Documentation ¶
Index ¶
- Constants
- Variables
- func AvailableCacheLevel() ([]string, error)
- func BitmapsCPUWrapper(cpuids interface{}) (*util.Bitmap, error)
- func BitmapsCacheWrapper(bitmask interface{}) (*util.Bitmap, error)
- func Get(request *restful.Request, response *restful.Response)
- func GetAvailableCacheSchemata(allres map[string]*resctrl.ResAssociation, ignoreGroups []string, pool string, ...) (map[string]*libutil.Bitmap, error)
- func GetCPUPools() (map[string]map[string]*util.Bitmap, error)
- func GetCachePoolLayout() (map[string]*Reserved, error)
- func GetCachePoolName(MaxWays, MinWays uint32) (string, error)
- func GetLLC() uint32
- func GetReservedInfo() map[string]*Reserved
- func GetSpecifiedCache(request *restful.Request, response *restful.Response)
- func GetSysCaches(level int) (map[string]SysCache, error)
- func LevelGet(request *restful.Request, response *restful.Response)
- func Register(prefix string, container *restful.Container)
- func SetInfraGroup() error
- func SetOSGroup() error
- type CachesSummary
- type CosInfo
- type Info
- type Infos
- type Reserved
- type Summary
- type SysCache
Constants ¶
const ( // SysCPUPath is patch of cpu device SysCPUPath = "/sys/devices/system/cpu/" // MaxMBAPercentage max value for MBA in percentage mode (just 100%) MaxMBAPercentage = 100 // MaxMBAMbps max value for MBA in controller (mbps) mode MaxMBAMbps = 4294967290 )
const ( // OS is os resource group name OS = "os" // Infra is infra resource group name Infra = "infra" // Guarantee is guarantee resource group name Guarantee = "guarantee" // Besteffort is besteffort resource group name Besteffort = "besteffort" Shared = "shared" )
Variables ¶
var ReservedInfo map[string]*Reserved
ReservedInfo is all reserved resource group information
var SizeMap = map[string]uint32{
"K": 1024,
"M": 1024 * 1024,
}
SizeMap is the map to bits of unit
Functions ¶
func AvailableCacheLevel ¶
AvailableCacheLevel returns the L2 and L3 level cache, strip L1 cache. By default, get the info from cpu0 path, any issue? The type of return should be string or int?
func BitmapsCPUWrapper ¶
BitmapsCPUWrapper is a wrapper for Bitmap
func BitmapsCacheWrapper ¶
BitmapsCacheWrapper is a wrapper for Cache bitmap
func GetAvailableCacheSchemata ¶
func GetAvailableCacheSchemata(allres map[string]*resctrl.ResAssociation, ignoreGroups []string, pool string, cacheLevel string) (map[string]*libutil.Bitmap, error)
GetAvailableCacheSchemata returns available schemata of caches from specific pool: guarantee, besteffort, shared or just none
func GetCPUPools ¶
GetCPUPools is helper function to get Reserved CPUs
func GetCachePoolLayout ¶
GetCachePoolLayout returns cache pool layout based on configuration
func GetCachePoolName ¶
GetCachePoolName will return pool name based on MaxCache, MinCache
func GetReservedInfo ¶
GetReservedInfo returns all reserved information
func GetSpecifiedCache ¶
func GetSpecifiedCache(request *restful.Request, response *restful.Response)
GetSpecifiedCache handles GET /v1/cache/l[2, 3]/{id}
func GetSysCaches ¶
GetSysCaches traverse all sys cache file for a specify level
func LevelGet ¶
func LevelGet(request *restful.Request, response *restful.Response)
LevelGet handles GET /v1/cache/l[2|3|lc]
func SetInfraGroup ¶
func SetInfraGroup() error
SetInfraGroup sets infra resource group based on configuration
Types ¶
type CachesSummary ¶
type CachesSummary struct { Rdt bool `json:"rdt"` Cqm bool `json:"cqm"` Cdp bool `json:"cdp"` CdpOn bool `json:"cdp_enable"` Cat bool `json:"cat"` CatOn bool `json:"cat_enable"` Caches map[string]Summary `json:"caches"` }
CachesSummary Cat, Cqm seems CPU's feature. Should be better
type Rdt struct { Cat bool CatOn bool Cdp bool CdpOn bool }
type Info ¶
type Info struct { ID uint32 `json:"cache_id"` NumWays uint32 NumSets uint32 NumPartitions uint32 LineSize uint32 TotalSize uint32 `json:"total_size"` WaySize uint32 NumClasses uint32 WayContention uint64 CacheLevel uint32 Location string `json:"location_on_socket"` Node string `json:"location_on_node"` AvailableWays string `json:"available_ways"` AvailableCPUs string `json:"available_cpus"` AvailableIsoCPUs string `json:"available_isolated_cpus"` AvailablePolicy map[string]uint32 `json:"available_policy"` // should move out here AvailableWaysPool map[string]string `json:"available_ways_pool"` }
Info is details of cache
type Infos ¶
Infos is group of cache info
func (*Infos) GetByLevel ¶
GetByLevel returns cache info by cache level
type Reserved ¶
type Reserved struct { AllCPUs *util.Bitmap //cpu bit mask SchemaNum int // Numbers of schema Name string // Resource group name if it is a resource group instead of pool Schemata map[string]*util.Bitmap // Schema list CPUsPerNode map[string]*util.Bitmap // CPU bitmap Quota uint // Max allowed usage for this resource Shrink bool // Wether shrink in BE pool }
Reserved schemata information
func GetInfraGroupReserve ¶
GetInfraGroupReserve returns reserved infra group NOTE This group can be merged into GetOSGroupReserve
func GetOSGroupReserve ¶
GetOSGroupReserve returns os reserved resource group