Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check for cpuset.cpus before set the value #16141

Closed
HuKeping opened this issue Sep 8, 2015 · 11 comments
Closed

check for cpuset.cpus before set the value #16141

HuKeping opened this issue Sep 8, 2015 · 11 comments

Comments

@HuKeping
Copy link
Contributor

HuKeping commented Sep 8, 2015

Here comes the example:

Assume I have 4 CPUs in my host, at the very beginning everything is OK for

 docker run -ti --name hkp_ubuntu  --cpuset-cpus=0-3 ubuntu bash

Then I put CPU1 off and then put it on

echo 0 > /sys/devices/system/cpu/cpu1/online

echo 1 > /sys/devices/system/cpu/cpu1/online

Let's check for the cpuset.cpus of cgroup docker

cat /sys/fs/cgroup/cpuset/docker/cpuset.cpus
0,2-3

And then run that docker CLI again, error happen

Error response from daemon: Cannot start container 0abdc40d8a96d66318340b863cff56177e4958540839440fb25edb8a57430c51: [8] System error: write /sys/fs/cgroup/cpuset/docker/0abdc40d8a96d66318340b863cff56177e4958540839440fb25edb8a57430c51/cpuset.cpus: invalid argument

This is because when we shut down CPU1, the cgroup system update all the sub-cgroup system about the cpuset.cpus. But when the CPU1 comes back it didn't do the same thing.

@HuKeping
Copy link
Contributor Author

HuKeping commented Sep 8, 2015

I'll raise a pr to libcontainer to fix it opencontainers/runc#254

@runcom
Copy link
Member

runcom commented Sep 8, 2015

@HuKeping your patch in runc is working fine with latest docker master

@hqhq
Copy link
Contributor

hqhq commented Sep 9, 2015

@runcom As I mentioned in opencontainers/runc#254 , I don't think it's a bug, WDYT?

@runcom
Copy link
Member

runcom commented Sep 9, 2015

@hqhq reading your conversation on runc, yeah it doesn't seems so but I'd like other maintainers to check on this before closing

@hqhq
Copy link
Contributor

hqhq commented Sep 9, 2015

@runcom Sure, just for clear, it is a problem, just I don't think there are anything we can do on Docker or runC side, it's not a Docker bug. It should be fixed on kernel side, but kernel didn't fix mutil hierarchy case.

@runcom
Copy link
Member

runcom commented Sep 9, 2015

@hqhq I see, libcontainer error is awful tho and reading from root cgroup isn't ok as highlighted on runc PR :/

@megastef
Copy link

megastef commented Sep 9, 2015

Q: When I run vmstat in a container, the CPU ticks do not change!
The displayed values are completly differnt from the host.

Is this related to this issue?

@HuKeping
Copy link
Contributor Author

@megastef seems not.

@thaJeztah
Copy link
Member

@HuKeping @hqhq so what's the status here; is this something to be solved in docker or in the kernel?

@HuKeping
Copy link
Contributor Author

They prefer not do this in docker but the kernel side

@thaJeztah
Copy link
Member

Thanks @HuKeping, I'll go ahead and close this, but feel free to comment here

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

No branches or pull requests

5 participants