chiark / gitweb /
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)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Nov 2017 18:48:38 +0000 (19:48 +0100)
commitaf8a841fa32a6db5eb584309184fcd73422d4faf
tree53801e9bbf92e7503ac4dabf45a73179ce08b76c
parent4ab04f56e2bcb7e6564bd3d6126518d196cbdfef
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