-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I did the following cpuset configuration:

if [ ! -d /sys/fs/cgroup ]; then
        echo "cgroup not supported by the kernel"
else
        mount -t cgroup cgroup /sys/fs/cgroup

        # needed to have the cgroup values inherited from
        # the parent cgroup
        echo 1 > /sys/fs/cgroup/cgroup.clone_children

        # create an empty cgroup 'cpu0'
        mkdir /sys/fs/cgroup/cpu0

        # create an empty cgroup 'cpu1'
        mkdir /sys/fs/cgroup/cpu1

        # assign cpu number '0' for cgroup cpu0
        echo 0 > /sys/fs/cgroup/cpu0/cpuset.cpus

        # move outself to this new cgroup
        echo $$ > /sys/fs/cgroup/cpu0

        # move all the tasks to the cpu0 cgroup
        # kernel threads won't be moved, don't worry about the
        # the errors.
        for i in $(cat /sys/fs/cgroup/tasks); do
                echo $i > /sys/fs/cgroup/cpu0/tasks || echo "failed to
add pid $i/$(cat /proc/$i/comm)"
        done

        # assign a cpu for cgroup cpu1
        echo 1 > /sys/fs/cgroup/cpu1/cpuset.cpus

        # make cpu1 exclusive so processes belonging
        # to the other cgroups won't be able to use it.
        echo 1 > /sys/fs/cgroup/cpu1/cpuset.cpu_exclusive
fi


At this point, most of the processes have been moved to the 'cpu0'
cgroup and will use the cpu0 only. That does not prevent the cpu1 to be
used by the kernel threads. Any application launched will run on cpu0 only.

After running 10 infinite loops, the cpu accounting gives:

cat /sys/fs/cgroup/cpu0/cpuacct.usage_percpu
418943579549 0

cat /sys/fs/cgroup/cpu1/cpuacct.usage_percpu
0 0

But the system is:

cat /sys/fs/cgroup/cpuacct.usage_percpu
456741213041 30734572583

My guess is that reflects the kernel booted with the two cpus before we
created the cgroup. I am investigation the 'isolcpus' kernel parameter.

I think it is a good starting point to do some consumption measurements.

Mike, Vincent, what do you think ? Do you need more informations or
anything else ?

Thanks
  -- Daniel

- -- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOU6AVAAoJEAKBbMCpUGYAbQoH/0NeKLecIuMT57B/w1Jid/bn
yzqD3zwMt0EfUwfsU6H5dAYgumMzKmWWXR9+7FvYhkcckXfzumiMLFKhIybrUSz/
LW7ymHwxXcHWqBTKwMCasHzo9WhlRTlLA1pGAqo0qtG1IBpalE68ZRwItdY/HSOw
0mDGoegq4DHQtcF64XwGRZJo2wAsamtlWGejFdqLQU4FONyYI42rLXMNAG6VD3vG
CJrIudH5hLz3ZBdHYeRB6kWaj1O4skAW6fgySASiqFWoEaZzvT/7UuVBEYawpuyT
Pm+U9OHAfHUWfnyDASFfx6ZQKRS5Uk40XzThjGgwoo598EN8FXZD3N6UZ1WmL2U=
=H00Z
-----END PGP SIGNATURE-----

_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to