]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/shared/bus-util.c
core: refactor cpu shares/blockio weight cgroup logic
authorLennart Poettering <lennart@poettering.net>
Fri, 11 Sep 2015 14:48:24 +0000 (16:48 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 11 Sep 2015 16:31:49 +0000 (18:31 +0200)
commitd53d94743c5e5e3a4a668b0c707826a90a08949a
treec9f88941f6a5f072263ee7707500d577bf077300
parentafc966e288b5013de55c56b18ddc9a5723b865d5
core: refactor cpu shares/blockio weight cgroup logic

Let's stop using the "unsigned long" type for weights/shares, and let's
just use uint64_t for this, as that's what we expose on the bus.

Unify parsers, and always validate the range for these fields.

Correct the default blockio weight to 500, since that's what the kernel
actually uses.

When parsing the weight/shares settings from unit files accept the empty
string as a way to reset the weight/shares value. When getting it via
the bus, uniformly map (uint64_t) -1 to unset.

Open up StartupCPUShares= and StartupBlockIOWeight= to transient units.
man/systemd.resource-control.xml
src/basic/cgroup-util.c
src/basic/cgroup-util.h
src/core/cgroup.c
src/core/cgroup.h
src/core/dbus-cgroup.c
src/core/load-fragment.c
src/core/unit.c
src/shared/bus-util.c