When system contains cgrules.conf file with few thousand rules,
cgroup_change_cgroup_flags() function without CGFLAG_USECACHE flag is very
slow.
As Ivana pointed out, cgexec and cgclassify tools might have problems with
cache
reloading, so I've removed them from the patch for now.
Currently, the patch affects only cgrulesengd daemon. Testing was done with
approximately 4000 users, rules in cgrules.conf file and same amount of
entries
in cgconfig.conf. Without the CGFLAG_USECACHE the cgrulesengd is starting
for
about 15 - 20 minutes (this is because of cgroup_change_all_cgroups()
function,
which scans all running processes on cgrulesengd start).
Signed-off-by: Peter Schiffer <pschiffe@redhat.com>
Acked-by: Ivana Hutarova Varekova <varekova@redhat.com>
if (err)
continue;
- err = cgroup_change_cgroup_flags(euid, egid, procname, pid, 0);
+ err = cgroup_change_cgroup_flags(euid,
+ egid, procname, pid, CGFLAG_USECACHE);
if (err)
cgroup_dbg("cgroup change pid %i failed\n", pid);
}