add cgroup subsystem hugetlb
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
This commit is contained in:
parent
cc555cce5f
commit
dfbea73df4
|
@ -19,6 +19,7 @@ var (
|
||||||
"cpuset": &CpusetGroup{},
|
"cpuset": &CpusetGroup{},
|
||||||
"cpuacct": &CpuacctGroup{},
|
"cpuacct": &CpuacctGroup{},
|
||||||
"blkio": &BlkioGroup{},
|
"blkio": &BlkioGroup{},
|
||||||
|
"hugetlb": &HugetlbGroup{},
|
||||||
"perf_event": &PerfEventGroup{},
|
"perf_event": &PerfEventGroup{},
|
||||||
"freezer": &FreezerGroup{},
|
"freezer": &FreezerGroup{},
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
package fs
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/docker/libcontainer/cgroups"
|
||||||
|
"github.com/docker/libcontainer/configs"
|
||||||
|
)
|
||||||
|
|
||||||
|
type HugetlbGroup struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *HugetlbGroup) Apply(d *data) error {
|
||||||
|
// we just want to join this group even though we don't set anything
|
||||||
|
if _, err := d.join("hugetlb"); err != nil && !cgroups.IsNotFound(err) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *HugetlbGroup) Set(path string, cgroup *configs.Cgroup) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *HugetlbGroup) Remove(d *data) error {
|
||||||
|
return removePath(d.path("hugetlb"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *HugetlbGroup) GetStats(path string, stats *cgroups.Stats) error {
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -38,6 +38,7 @@ var subsystems = map[string]subsystem{
|
||||||
"cpuset": &fs.CpusetGroup{},
|
"cpuset": &fs.CpusetGroup{},
|
||||||
"cpuacct": &fs.CpuacctGroup{},
|
"cpuacct": &fs.CpuacctGroup{},
|
||||||
"blkio": &fs.BlkioGroup{},
|
"blkio": &fs.BlkioGroup{},
|
||||||
|
"hugetlb": &fs.HugetlbGroup{},
|
||||||
"perf_event": &fs.PerfEventGroup{},
|
"perf_event": &fs.PerfEventGroup{},
|
||||||
"freezer": &fs.FreezerGroup{},
|
"freezer": &fs.FreezerGroup{},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue