[lxc-devel] /proc/cpuinfo per cgroup

Marian Marinov mm at yuhu.biz
Mon Nov 25 13:30:03 UTC 2013


Hi guys,
I'm using LXC containers for some of my teaching and I want to have /proc/cpuinfo and /proc/memory based on the cgroup 
limits that I have set.

The idea is that if one container is limited to a cpuset of 0-1 it should see only the first two cores and not all the 
cores on the machine.

The same thing is needed for the memory.

I simply want my students see the actual resources that they have.

Does any of you have any suggestions?

I'm planning to patch the kernel. As far as I can see it, I need to patch the following files:
./tile/kernel/proc.c
./sh/kernel/cpu/proc.c
./x86/kernel/cpu/proc.c
./mips/kernel/proc.c

Actually the c_start function.

Marian




More information about the lxc-devel mailing list