[systemd-devel] Improving module loading

Hoyer, Marko (ADITG/SW2) mhoyer at de.adit-jv.com
Sun Dec 21 08:42:23 PST 2014


> -----Original Message-----
> From: Ivan Shapovalov [mailto:intelfx100 at gmail.com]
> Sent: Sunday, December 21, 2014 3:26 PM
> To: systemd-devel at lists.freedesktop.org
> Cc: Hoyer, Marko (ADITG/SW2); Umut Tezduyar Lindskog
> Subject: Re: [systemd-devel] Improving module loading
> 
> On Sunday, December 21, 2014 at 01:03:36 PM, Hoyer, Marko wrote:
> > > -----Original Message-----
> > > From: Umut Tezduyar Lindskog [mailto:umut at tezduyar.com]
> > > Sent: Saturday, December 20, 2014 6:45 PM
> > > To: Hoyer, Marko (ADITG/SW2)
> > > Cc: systemd-devel at lists.freedesktop.org
> > > Subject: Re: [systemd-devel] Improving module loading
> > >
> > > [...]
> > > > I had such a discussion earlier with some of the systemd guys. My
> > > intention was to introduce an additional unit for module loading
> for
> > > exactly the reason you mentioned. The following (reasonable)
> outcome
> > > was:
> > >
> > > Do you have links for the discussions, I cannot find them.
> >
> > Actually not, sorry. The discussion was not done via any mailing
> list.
> >
> > > systemd already has a service that loads the modules.
> >
> > Sorry, there is a word missing in my sentence above. My idea was not
> to introduce a "unit" for modules loading but an own "unit type", such
> as .kmodule. The idea was to define .kmodule units to load one or a set
> of kernel modules each at a certain point during startup by just
> integrating them into the startup dependency tree. This idea would
> require integrating kind of worker threads into systemd. The outcome
> was as summarized below.
> 
> Why would you need a separate unit type for that?
> 
> load-module at .service:
> 
> [Unit]
> Description=Load kernel module %I
> DefaultDependencies=no
> 
> [Service]
> Type=oneshot
> RemainAfterExit=yes
> ExecStart=/usr/bin/modprobe %I

To prevent forking a process for that ... We earlier had some issue with cgroups in the kernel, which caused between 20 and 60ms delay per process executed by systemd. 

But actually we are doing it now exactly this way but not with modprobe but another tool, which can load modules in parallel, takes care for synchronization (devices and attributes), and does some other stuff as well ...

In some cases, we don't even have an additional unit for that. We are just putting the kmod call with an ExecStartPre= Statement into the service file, which requires the module / modules being load before. 

> 
> ...then add a dependency like Required=load-module at foo.service and
> After=load-module at foo.service.
> 
> --
> Ivan Shapovalov / intelfx /


Best regards

Marko Hoyer
Software Group II (ADITG/SW2)

Tel. +49 5121 49 6948


More information about the systemd-devel mailing list