[systemd-devel] make systemd service takes cpu exclusively

Umut Tezduyar Lindskog umut at tezduyar.com
Mon Nov 17 01:51:11 PST 2014


Hi XinX

On Mon, Nov 17, 2014 at 9:40 AM, Cao, XinX <xinx.cao at intel.com> wrote:
> Hi, everybody,
>
>
>
>             As we all know that currently systemd puts all the services into
> a run_queue, and lets them run together as possible as it can. However, this
> mechanism also brings in a problem, which means all the services will
> contend for CPU, and systemd is unable to make sure one service has priority
> ONE  and only itself takes the CPU when this service is starting.

What exactly is the problem when they all want to get the CPU?

>
>
>
>             For example, if we want to make sure a.service runs firstly ,
> and all the other services runs after  a.service is finished.
>
>
>
>             So, does anybody know if systemd has this kind of mechanism?  If
> not, can we create a way to do this and add this feature into systemd? Or
> is this idea possible?  I think this is very usefull under some situations.

It really depends on your use case and what you consider with
"a.service runs first".

If you only want to start the service first, then you can always add
After=a.service directive to other services that are starting at the
same time. But this is pretty static information. You have to do this
for every time you change your priority service.

You could also prioritize a service by changing their
StartupCPUShares= but this is not truly stopping other services from
being scheduled in. Maybe they get the minimum CPU, but they still do.

Lennart has recently considered to change the startup queue to
prioritized startup queue where a prioritized service will be forked
off before other services -
http://lists.freedesktop.org/archives/systemd-devel/2014-October/024315.html.

Umut

>
>
>
>             Thanks~
>
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>


More information about the systemd-devel mailing list