cgroup: when dispatching the cgroup realization queue, check again if we shall actual...
authorLennart Poettering <lennart@poettering.net>
Fri, 24 Nov 2017 18:48:38 +0000 (19:48 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 25 Nov 2017 16:08:21 +0000 (17:08 +0100)
commit2aa57a655004c8f9fba48eeb71aa9a31fdf3c94b
tree1235886eaf9067835f3f26546a2e5ea3d719232a
parent0f2d84d2ccda91bb1c1d9a5f24bfeab136e195eb
cgroup: when dispatching the cgroup realization queue, check again if we shall actually realize

We add units to the cgroup realization queue when propagating realizing
requests to sibling units, and when invalidating cgroup settings because
some cgroup setting changed. In the time between where we add the unit
to the queue until the cgroup is actually dispatched the unit's state
might have changed however, so that the unit doesn't actually need to be
realized anymore, for example because the unit went down. To handle
that, check the unit state again, if realization makes sense.

Redundant realization is usually not a problem, except when the unit is
not actually running, hence check exactly for that.
src/core/cgroup.c