Hi,
this has been posted quite some time ago without any feedback. Does
it mean that the patch is not appropriate/correct or it just slipped
through?

On Mon 12-01-15 16:25:28, Michal Hocko wrote:
> Hi,
> would you consider the following fix? This has been reported against an
> older version of the package but the issue is still present in upstream.
> Just try:
> CREATE_DEFAULT=yes
> and configure sysdefault cgroup via /etc/cgconfig.conf
> group /sysdefault {
>     cpuset {
>         cpuset.cpus = 0;
>         cpuset.mems = 0;
>     }
> }
> 
> This configuration will get overwritten by /etc/init.d/cgconfig start
> 
> ---
> >From 1f56fee18da3d7b1039eea10cc5f6a01026f089b Mon Sep 17 00:00:00 2001
> From: Michal Hocko <mho...@suse.cz>
> Date: Mon, 12 Jan 2015 15:47:08 +0100
> Subject: [PATCH] cgconfig: Do not overwrite defaultcgroup configuration
> 
> cpuset controller doesn't accept any tasks until cpuset.cpus and
> cpuset.mems are configured. cgconfig init script tries to create
> and configure defaultcgroup when enabled but it doesn't check whether
> the defaultcgroup already exists and it is configured from
> /etc/cgconfig.conf and happily overwrites the configuration. This is
> clearly wrong. Fix this simply by checking both knobs and inherit the
> value from root only when uninitialized.
> 
> Signed-off-by: Michal Hocko <mho...@suse.cz>
> ---
>  scripts/init.d/cgconfig.in | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/init.d/cgconfig.in b/scripts/init.d/cgconfig.in
> index f299d0ff3f73..45b370266f0c 100644
> --- a/scripts/init.d/cgconfig.in
> +++ b/scripts/init.d/cgconfig.in
> @@ -78,13 +78,21 @@ create_default_groups() {
>          cgcreate -f 664 -d 775 -g $controllers:$defaultcgroup 2>/dev/null
>  
>          #
> -        # special rule for cpusets
> +        # cpusets need cpus and mems to initialized which is not the case
> +        # for the freshly created groups. Inherit values from / if the
> +        # defaultcgroup is not initialized
>          #
>          if echo $controllers | grep -q -w cpuset; then
> -                cpus=`cgget -nv -r cpuset.cpus /`
> -                cgset -r cpuset.cpus=$cpus $defaultcgroup
> -                mems=`cgget -nv -r cpuset.mems /`
> -                cgset -r cpuset.mems=$mems $defaultcgroup
> +             if [ -z "`cgget -nv -r cpuset.cpus $defaultcgroup`" ]
> +             then
> +                     cpus=`cgget -nv -r cpuset.cpus /`
> +                     cgset -r cpuset.cpus=$cpus $defaultcgroup
> +             fi
> +             if [ -z "`cgget -nv -r cpuset.mems $defaultcgroup`" ]
> +             then
> +                     mems=`cgget -nv -r cpuset.mems /`
> +                     cgset -r cpuset.mems=$mems $defaultcgroup
> +             fi
>          fi
>  
>          #
> -- 
> 2.1.4
> 
> -- 
> Michal Hocko
> SUSE Labs

-- 
Michal Hocko
SUSE Labs

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to