[systemd-devel] Services started realtime exit with 214

Lennart Poettering lennart at poettering.net
Mon Jul 11 09:27:26 PDT 2011


On Mon, 11.07.11 12:40, Barry Scott (barry.scott at onelan.co.uk) wrote:

> I am trying to run services realtime with systemd on Fedora 15.
> 
> Here is the Service section that I think we need to do this.
> 
> [Service]
> StandardOutput=syslog
> WorkingDirectory=/data/data/logs
> 
> LimitCORE=infinity
> LimitRTPRIO=2
> LimitRTTIME=60000000
> CPUSchedulingPolicy=rr
> CPUSchedulingPriority=1
> 
> ExecStartPre=-/bin/plymouth quit --retain-splash
> ExecStart=/usr/bin/Xorg :0 -noreset -nolisten tcp -background none vt1 -dpi 75 -logfile /data/data/logs/screen-server.log -dumbSched -config /etc/onelan/ntb/x.conf
> 
> # systemctl status screen.service
> screen.service - Screen arbitration server for the display
>           Loaded: loaded (/etc/systemd/system/screen.service)
>           Active: failed since Mon, 11 Jul 2011 11:55:45 +0100; 19min ago
>          Process: 990 ExecStart=/usr/bin/Xorg :0 -noreset -nolisten tcp -background none vt1 -dpi 75 -logfile /data/data/logs/screen-server.log -dumbSched -config /etc/onelan/ntb/x.conf (code=exited, status=214/SETSCHEDULER)
>          Process: 988 ExecStartPre=/bin/plymouth quit --retain-splash (code=exited, status=214/SETSCHEDULER)
>           CGroup: name=systemd:/system/screen.service
> 
> Why is the sched_scheduler call failing?
> 
> Do we have to configure something else to get this working like cgroup stuff?

Running X under RR privs? That's bold.

I figure this fails due to the fact that by default we place every
service in its own cgroup in the "cpu" hierarchy, in order to distribute
the available CPU time evenly among the available processes. However,
because the "cpu" controller currently isn't that nice to use this
breaks RT, since if you create a group to allow it RT you need to assign
an RT budget to it, which we however cannot really do, since we cannot
come up with any sane default for it.

There are two ways out of this:

a) disable the implicit sortining into separate cpu cgroups globally, by
setting "DefaultControllers=" (i.e. setting it to the empty string) in
/etc/systemd/system.conf

or

b) disable the automatic creation of a "cpu" cgroup only for this one
service, by placing "ControlGroup=cpu:/" in it.

I recommend the latter.

That this is necessary is very unfortunate and I really hope the cpu
controller can be fixed one day, so that RT budgets and normal
scheduling budgets are independent.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list