mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
e92f2fd395
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
23 lines
410 B
Go
23 lines
410 B
Go
package fs
|
|
|
|
import (
|
|
"strconv"
|
|
)
|
|
|
|
type cpuGroup struct {
|
|
}
|
|
|
|
func (s *cpuGroup) Set(d *data) error {
|
|
// We always want to join the cpu group, to allow fair cpu scheduling
|
|
// on a container basis
|
|
dir, err := d.join("cpu")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if d.c.CpuShares != 0 {
|
|
if err := writeFile(dir, "cpu.shares", strconv.FormatInt(d.c.CpuShares, 10)); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|