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

fix /sys/devices/system/cpu/online in cpuset not correct bug #305

Merged
merged 1 commit into from Sep 6, 2019

Conversation

@yinhongbo
Copy link

commented Sep 6, 2019

When the container runs in cpuset and cpu quota, for example, cpu quota is limited to 8 cores, cpuset is limited to 1-3, 4-5, then there will be problems. The core number obtained by /proc/cpuinfo is 4 cores, and /sys /devices/system/cpu/online gets 8 cores.
The reason is that /sys/devices/system/cpu/online does not take into account the situation of cpuset. So submit this patch.

Test case:
docker run -it -d --cpuset-cpus="1-2,3-4" \ --cpu-period=100000 \ --cpu-quota=800000 \ --memory 2048m \ -v /root/tce/lxcfs/run/lxcfs/sys/devices/system/cpu/online:/sys/devices/system/cpu/online \ -v /root/tce/lxcfs/run/lxcfs/proc/cpuinfo:/proc/cpuinfo:rw \ debian:latest bash

Signed-off-by: Hongbo Yin yinhongbo@bytedance.com

fix /sys/devices/system/cpu/online in cpuset not correct bug
Signed-off-by: Hongbo Yin <yinhongbo@bytedance.com>

@brauner brauner merged commit 687eb38 into lxc:master Sep 6, 2019

3 checks passed

Branch target Branch target is correct
Details
DCO All commits signed-off
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@brauner

This comment has been minimized.

Copy link
Member

commented Sep 6, 2019

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.