[systemd-devel] Set cgroup attributes not supported by systemd - what do you recommend?

Barry Scott barry.scott at onelan.co.uk
Fri Jan 24 09:59:56 PST 2014


On Fri 24 Jan 2014 11:37:49 Lennart Poettering wrote:
> On Thu, 23.01.14 11:55, Barry Scott (barry.scott at onelan.co.uk) wrote:
> > I am running systemd 208 on Fedora 20.
> > 
> > There are 2 cpu cgroup attributes that I need to set to allow realtime for
> > some daemons: cpu.rt_period_us and cpu.rt_runtime_us.
> > 
> > For the memory cgroup I need to set memory.memsw.limit_in_bytes for one of
> > my slices.
> > 
> > Do you plan to add support for setting these attributes in a future
> > systemd
> > update?
> 
> Yes, but don't hold your breath...
> 
> Basically, we are currently only exposing attributes that Tejun (the
> kernel cgroups maintainer) considers to be attributes that are going to
> be available after the cgroup rework is finished. The memsw and RT stuff
> does not really fall into that category, it is not clear that they will
> be available after the kernel clean-up, and if they will, then  not
> necessarily with the same semantics.
> 

Thanks we'll keep track of what Tejun is planning.

Just for the record we don't care if cgroups manages the RT stuff all
we need to be able to do is have the ability to call setrlimit() and
sched_setscheduler().

We have a use case for memsw as a cgroup attribute, however we are
open to arguments that its not needed.

> > Until there is support I could have a .service run code to setup the
> > attributes for the .slice's before services that need the changes.
> > 
> > Would that be a suitable workaround until there is support in systemd?
> 
> For now, I recommend adding a small ExecStartPre= script into the
> respective services, that gets passed "%c" which resolves to the cgroup
> path. Then, in that script simply echo the values you need into the
> right attributes.

I have the moral equivalent that I'm getting going now.

> Lennart

Barry



More information about the systemd-devel mailing list