Re: [systemd-devel] set rr scheduler failed with cpushares
Hi, On Tue, Dec 2, 2014 at 7:12 PM, Lennart Poettering lenn...@poettering.net wrote: On Mon, 17.11.14 23:46, WaLyong Cho (walyong@samsung.com) wrote: Hello, I'd made two different services. One has *CPUSchedulingPolicy=rr* and the others has *CPUShares=*. Could anyone help me? If CPUShares= is set this has the effect that the service and all services in the same slice will be have the cpu cgroup controller turned on. Unfortunately this has the effect that RT scheduling will be unavailable then, unless an explicit RT budget is configured for that specific cgroup. This is something systemd cannot be used for nicely however, as we don't expose high-level controls for the RT budget. The RT budget is configured in the cpu.rt_runtime_us and cpu.rt_period_us cgroup attributes. You can write to them from ExecStartPre= for example using the %c specified. Wouldn't it be against the idea of access to control groups should go through systemd? Is this something you are recommending until we start exposing RT parts of the cgroups, or? Umut Another option is to simply disable CONFIG_RT_GROUP_SCHED in the kernel, if you don't need it anyway. Lennart -- Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] set rr scheduler failed with cpushares
On Wed, 03.12.14 22:13, Umut Tezduyar Lindskog (u...@tezduyar.com) wrote: Hi, On Tue, Dec 2, 2014 at 7:12 PM, Lennart Poettering lenn...@poettering.net wrote: On Mon, 17.11.14 23:46, WaLyong Cho (walyong@samsung.com) wrote: Hello, I'd made two different services. One has *CPUSchedulingPolicy=rr* and the others has *CPUShares=*. Could anyone help me? If CPUShares= is set this has the effect that the service and all services in the same slice will be have the cpu cgroup controller turned on. Unfortunately this has the effect that RT scheduling will be unavailable then, unless an explicit RT budget is configured for that specific cgroup. This is something systemd cannot be used for nicely however, as we don't expose high-level controls for the RT budget. The RT budget is configured in the cpu.rt_runtime_us and cpu.rt_period_us cgroup attributes. You can write to them from ExecStartPre= for example using the %c specified. Wouldn't it be against the idea of access to control groups should go through systemd? Yes, it is against that idea, absolutely. Is this something you are recommending until we start exposing RT parts of the cgroups, or? No. It's more difficult: the kernel API is awful here (since it really shouldn't break RT without explicit initialization), and it will reappear in a very different form in the unified hierarchy. We will however only expose it as soon as we know how it looks in the new hierarchy. Until then things are not pretty: we won't expose firendly options for them, hence there's really no other way than hackishly writing to the attributes directly, even though this is clearly something that will stop working as soon as the unified hierarchy is adopted. Lennart -- Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] set rr scheduler failed with cpushares
On Mon, 17.11.14 23:46, WaLyong Cho (walyong@samsung.com) wrote: Hello, I'd made two different services. One has *CPUSchedulingPolicy=rr* and the others has *CPUShares=*. Could anyone help me? If CPUShares= is set this has the effect that the service and all services in the same slice will be have the cpu cgroup controller turned on. Unfortunately this has the effect that RT scheduling will be unavailable then, unless an explicit RT budget is configured for that specific cgroup. This is something systemd cannot be used for nicely however, as we don't expose high-level controls for the RT budget. The RT budget is configured in the cpu.rt_runtime_us and cpu.rt_period_us cgroup attributes. You can write to them from ExecStartPre= for example using the %c specified. Another option is to simply disable CONFIG_RT_GROUP_SCHED in the kernel, if you don't need it anyway. Lennart -- Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] set rr scheduler failed with cpushares
Hello, I'd made two different services. One has *CPUSchedulingPolicy=rr* and the others has *CPUShares=*. # cat foo.service [Unit] Description=foo has CPUSchedulingPolicy= [Service] RemainAfterExit=yes ExecStart=/bin/true CPUSchedulingPolicy=rr # cat bar.service [Unit] Description=bar has CPUShares= [Service] RemainAfterExit=yes ExecStart=/usr/bin/hello.sh CPUShares=100 foo.service is activated well if bar.service is not activated. # systemctl start foo.service; systemctl status foo.service bar.service foo.service - foo has CPUSchedulingPolicy= Loaded: loaded (/usr/lib/systemd/system/foo.service; static) Active: active (exited) since Mon 2014-11-17 23:32:44 KST; 5s ago Process: 2702 ExecStart=/bin/true (code=exited, status=0/SUCCESS) Main PID: 2702 (code=exited, status=0/SUCCESS) bar.service - bar has CPUShares= Loaded: loaded (/usr/lib/systemd/system/bar.service; static) Active: inactive (dead) But if bar.service(what has CPUShares=) then foo.service failed on sched_setscheduler(). EPERM was returned. # systemctl start bar.service; systemctl restart foo.service; systemctl status foo.service bar.service foo.service - foo has CPUSchedulingPolicy= Loaded: loaded (/usr/lib/systemd/system/foo.service; static) Active: active (exited) (Result: exit-code) since Mon 2014-11-17 23:34:48 KST; 75ms ago Process: 3222 ExecStart=/bin/true (code=exited, status=214/SETSCHEDULER) Main PID: 3222 (code=exited, status=214/SETSCHEDULER) Nov 17 23:34:48 KIRAN systemd[1]: Started foo has CPUSchedulingPolicy=. Nov 17 23:34:48 KIRAN systemd[1]: foo.service: main process exited, code=ex...ER bar.service - bar has CPUShares= Loaded: loaded (/usr/lib/systemd/system/bar.service; static) Active: active (running) since Mon 2014-11-17 23:34:48 KST; 296ms ago Main PID: 3218 (hello.sh) CGroup: /system.slice/bar.service ├─3218 /bin/bash /usr/bin/hello.sh └─3221 sleep 1 Could anyone help me? Thanks, WaLyong ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel