[systemd-devel] [PATCH] core: add startup resource control option
Lennart Poettering
lennart at poettering.net
Wed Apr 23 14:15:26 PDT 2014
On Wed, 26.03.14 00:12, WaLyong Cho (walyong.cho at samsung.com) wrote:
>
> On 03/25/2014 05:01 AM, Lennart Poettering wrote:
> > On Tue, 25.03.14 01:03, WaLyong Cho (walyong.cho at samsung.com) wrote:
> >
> >> /* Figure out which controllers we need */
> >>
> >> - if (c->cpu_accounting || c->cpu_shares != 1024)
> >> + if (c->cpu_accounting ||
> >> + c->startup_cpu_shares != 1024 ||
> >> + (manager_state(m) != MANAGER_STARTING && c->cpu_shares !=
> >> 1024))
> >
> > This looks incorrect. Shouldn't it be like this:
> >
> > ...
> >
> > if (c->cpu_accounting ||
> > (manager->state(m) == MANAGER_STARTING ? c->startup_cpu_shares : c->cpu_shares) != 1024)
> >
>
> At previous patch, I also wrote similar with your thought. Assume, some
> of units just only specified StartupCPUShares=(or
> StartupBlockIOWeight=). In this case, that unit will not be changed to
> default weight because global state is already changed to running. So I
> put startup_cpu_shares condition alone.
No sure I understand. The service processes should be removed from the
CPU cgroup as soon as the global state reaches RUNNING if only
CPUShares= is set, but StartupCPUShares= isn't? Hence the startup cpu
shares value should not have an effect anymore. Am I missing something?
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list