Fixes/issue28 #38

merged 2 commits into from Mar 19, 2013

2 participants


please review patch (2 actually) fixing issue28.

gajdusek added some commits Jun 29, 2012
@gajdusek gajdusek scheduler: Do not reinitialize parent cgroups everytime a child group…
… is created.

Whenever scheduler find a process matching rule and correspondent cgroup
does not yet exist, scheduler blindly tries to create all parental
cgroups, ignoring they may already be there.

adjust_new() functions are repeatedly called upon already existing
cgroups and adjust() function is repeatedly added to them.
@gajdusek gajdusek core.lua: fix for cgroups removed outside ulatencyd (issue #28)
fixes issue #28: CGroup properties not set.

Whenever scheduler finds matching rule for scheduled process, it calls
CGroup.get_group(name) to check if cgroup does exist. This used to check
only if cgroup is contained in the internal _CGroup_Cache - not if it really
does exist in cgroup filesystem.

So if the cgroup was removed outside ulatencyd and therefore was not
removed from _CGroup_Cache, cgroup will not be recreated and will loose
all settings (default parameters, rule parameters, parameters adjusted
by adjust_new).

 + CGroup.get_group(): test if cgroup is really present in filesystem,
   otherwise return false or nil.
 + always create requested cgroup. If it is already
   contained in _CGroup_Cache, replace it with new one. Code should check
   its existence before calling anyway.

Real fix would involve changing ulatencyd_cleanup.lua in a way it tells
ulatencyd to remove that cgroup. Ulatencyd should also update its internal
structures and do clean up, i.e. handle remaining memory charges.

Oops. it was not my indent to create new issue for this pull request, but I was not able to figure out, how attach this to issue 28. Did I missed something?

@poelzi poelzi merged commit bfbb838 into poelzi:master Mar 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment