Il 29/06/2010 19:51, Dhaval Giani ha scritto:
We don't seem to writing the data in that order. It seems to be a
stack order, but I don't recall writing the code that way. I think its
high time I take a look at that code again.
So it seems: top-to-bottom for groups, but bottom-to-top for entries inside each group [1] -- not really something a user might expect :-( Also, I just checked and a second entry with the same name unfortunately (for my case) gives an error.
setup the cgroups. Tommaso, would it be possible to share your
configuration file? If it is too big, you could probably send it to me
privately.
Already copied relevant info here, however find it attached.

Yet another question: assuming a subtree of the cgroups fs is owned by an unprivileged user (and of course that the subgroup was created by root), having an entry like this:

group /path/to/private-group {
   ...
}

in a private configuration file of mine (i.e., $HOME/.cgconfig.rc) would allow me to run cgconfigparser over it without errors, or would it try to actually create the groups that already exist and fail because of the unprivileged status ?

Thanks again,

    T.

[1]
group . {
    cpu {
        cpu.rt_period_us = 100000;
        cpu.rt_runtime_us = 95000;
        cpu.rt_task_period_us = 100000;
        cpu.rt_task_runtime_us = 20000;
    }
}

group aquosa {
    cpu {
        cpu.rt_period_us = 100000;
        cpu.rt_runtime_us = 40000;
        cpu.rt_task_period_us = 100000;
        cpu.rt_task_runtime_us = 0;
    }
}
$ LD_LIBRARY_PATH=../.libs sudo strace ./.libs/cgconfigparser -l /etc/cgconfig.conf 2>&1 | grep cpu.rt_
[...]
open("/mnt/cgroups/cpu/./cpu.rt_task_runtime_us", O_RDWR) = 4
open("/mnt/cgroups/cpu/./cpu.rt_task_period_us", O_RDWR) = 4
open("/mnt/cgroups/cpu/./cpu.rt_runtime_us", O_RDWR) = 4
open("/mnt/cgroups/cpu/./cpu.rt_period_us", O_RDWR) = 4
open("/mnt/cgroups/cpu/aquosa/cpu.rt_task_runtime_us", O_RDWR) = 4
open("/mnt/cgroups/cpu/aquosa/cpu.rt_task_period_us", O_RDWR) = 4
open("/mnt/cgroups/cpu/aquosa/cpu.rt_runtime_us", O_RDWR) = 4
open("/mnt/cgroups/cpu/aquosa/cpu.rt_period_us", O_RDWR) = 4

--
Tommaso Cucinotta, Computer Engineering PhD, Researcher
ReTiS Lab, Scuola Superiore Sant'Anna, Pisa, Italy
Tel +39 050 882 024, Fax +39 050 882 003
http://retis.sssup.it/people/tommaso

#
#  Copyright IBM Corporation. 2007
#
#  Authors:     Balbir Singh <[email protected]>
#  This program is free software; you can redistribute it and/or modify it
#  under the terms of version 2.1 of the GNU Lesser General Public License
#  as published by the Free Software Foundation.
#
#  This program is distributed in the hope that it would be useful, but
#  WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
#group daemons/www {
#       perm {
#               task {
#                       uid = root;
#                       gid = webmaster;
#               }
#               admin {
#                       uid = root;
#                       gid = root;
#               }
#       }
#       cpu {
#               cpu.shares = 1000;
#       }
#}
#
#group daemons/ftp {
#       perm {
#               task {
#                       uid = root;
#                       gid = ftpmaster;
#               }
#               admin {
#                       uid = root;
#                       gid = root;
#               }
#       }
#       cpu {
#               cpu.shares = 500;
#       }
#}
#
mount {
        cpu = /mnt/cgroups/cpu;
        cpuacct = /mnt/cgroups/cpuacct;
}

group . {
        perm {
                task {
                        uid = root;
                        gid = root;
                }
                admin {
                        uid = root;
                        gid = root;
                }
        }
        cpu {
                cpu.rt_period_us = 100000;
                cpu.rt_runtime_us = 95000;
                cpu.rt_task_period_us = 100000;
                cpu.rt_task_runtime_us = 20000;
        }
}

group aquosa {
        perm {
                task {
                        uid = root;
                        gid = users;
                }
                admin {
                        uid = root;
                        gid = users;
                }
        }
        cpu {
                cpu.rt_period_us = 100000;
                cpu.rt_runtime_us = 40000;
                cpu.rt_task_period_us = 100000;
                cpu.rt_task_runtime_us = 0;
        }
        cpuacct {
        }
}
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to