]> git.ipfire.org Git - thirdparty/systemd.git/commit
pid1: order jobs that execute processes with lower priority
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 18 Jul 2019 16:30:15 +0000 (18:30 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 19 Jul 2019 05:38:52 +0000 (14:38 +0900)
commit217b7b33ccb29de90c6ab3ff0c43f55d6e31026d
treef5f6b57ccd74136c4803be43c160776da2640aab
parent65dd488fe1e85cf8b573ead8f7c67dde2bad4ce8
pid1: order jobs that execute processes with lower priority

We can meaningfully compare jobs for units which have cpu weight or nice set.
But non-exec units those have those set.

Starting non-exec jobs first allows us to get them out of the queue quickly,
and consider more jobs for starting.

If we have service A, and socket B, and service C which is after socket B,
and we want to start both A and C, and C has higher cpu weight, if we get
B out of the way first, we'll know that we can start both A and C, and we'll
start C first.

Also invert the comparisons using CMP() so they are always done left vs. right,
and negate when returning instead.

Follow-up for da8e178296.
src/core/cgroup.c