Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

WeiZhang555
Copy link
Contributor

Using linux resource in spec:

"resources": {
    "cpu": {
        "period": 100000,
        "quota": 40000
    },
...
}

In this case, resources.CPU != nil but resources.CPU.Cpus and resources.CPU.Mems
are empty strings, cgroups lib will write "" to cpuset.cpus and cpuset.mems in
Cpuset group, then no process can be written in this cgroup any more.

In this case, empty value means copying from parent but doesn't mean no CPU can
be used in this cgroup.

Signed-off-by: Wei Zhang [email protected]

Using linux resource in spec:

```
"resources": {
    "cpu": {
        "period": 100000,
        "quota": 40000
    },
...
}
```

In this case, `resources.CPU` != nil but `resources.CPU.Cpus` and `resources.CPU.Mems`
are empty strings, `cgroups` lib will write "" to cpuset.cpus and cpuset.mems in
Cpuset group, then no process can be written in this cgroup any more.

In this case, empty value means copying from parent but doesn't mean no CPU can
be used in this cgroup.

Signed-off-by: Wei Zhang <[email protected]>
@WeiZhang555
Copy link
Contributor Author

Note that previous code if t.value != nil will always be true

@WeiZhang555
Copy link
Contributor Author

ping @crosbymichael

@crosbymichael
Copy link
Member

LGTM

Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@estesp estesp merged commit 5017d4e into containerd:master Sep 17, 2018
@WeiZhang555
Copy link
Contributor Author

Thank you @crosbymichael @estesp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants