Check sysinfo for Cpuset cpu.shares and blkio

Carried: #14015

If kernel is compiled with CONFIG_FAIR_GROUP_SCHED disabled cpu.shares
doesn't exist.
If kernel is compiled with CONFIG_CFQ_GROUP_IOSCHED disabled blkio.weight
doesn't exist.
If kernel is compiled with CONFIG_CPUSETS disabled cpuset won't be
supported.

We need to handle these conditions by checking sysinfo and verifying them.

Signed-off-by: Zefan Li <lizefan@huawei.com>
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
Qiang Huang 2015-08-05 22:35:18 +08:00
parent 4c56c9f9ba
commit 3ed5407e61
2 changed files with 53 additions and 0 deletions

View file

@ -8,6 +8,8 @@ type SysInfo struct {
*cgroupMemInfo
*cgroupCPUInfo
*cgroupBlkioInfo
*cgroupCpusetInfo
// Whether IPv4 forwarding is supported or not, if this was disabled, networking will not work
IPv4ForwardingDisabled bool
@ -37,9 +39,22 @@ type cgroupMemInfo struct {
}
type cgroupCPUInfo struct {
// Whether CPU shares is supported or not
CPUShares bool
// Whether CPU CFS(Completely Fair Scheduler) period is supported or not
CPUCfsPeriod bool
// Whether CPU CFS(Completely Fair Scheduler) quota is supported or not
CPUCfsQuota bool
}
type cgroupBlkioInfo struct {
// Whether Block IO weight is supported or not
BlkioWeight bool
}
type cgroupCpusetInfo struct {
// Whether Cpuset is supported or not
Cpuset bool
}