public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Bart Van Assche <Bart.VanAssche-Sjgp3cTcYWE@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"benjamin.drung-EIkl63zCoXaH+58JC4qpiA@public.gmane.org"
	<benjamin.drung-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
Subject: Re: [PATCH] Add rdma service for kernel boot support
Date: Thu, 13 Jul 2017 16:15:20 -0600	[thread overview]
Message-ID: <20170713221520.GA10088@obsidianresearch.com> (raw)
In-Reply-To: <1499970786.2740.17.camel-Sjgp3cTcYWE@public.gmane.org>

On Thu, Jul 13, 2017 at 06:33:07PM +0000, Bart Van Assche wrote:
> On Thu, 2017-07-13 at 12:20 -0600, Jason Gunthorpe wrote:
> > Here is an untested attempt to move module loading into srp_daemon -
> > what do you think Bart?
> 
> Hello Jason,
> 
> Thanks for the patch. To me this looks like a nice simplification compared
> to the current approach. Do you want me to test this patch?

I did some more steps..

Benjamin/Bart let me know what you think, I'll send the patches to the
list if you like the idea.

https://github.com/jgunthorpe/rdma-plumbing/tree/systemd

This replaces Benjamins rdma.conf based approach.

The basic approach is to directly use systemd to load the modules and
determine what modules to load by using udev and explicit Requires in
the units.

Eg, the extra modules for mlx4 are loaded by triggering this udev rule:

SUBSYSTEM=="module", KERNEL=="mlx4_core", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma-load-modules@mlx4"

Which causes the module loader to load the contents of the modules
list in /etc/rdma/modules/mlx4.conf

If the user does not want a specific to load then they can comment out
the module line in the /etc/rdma/modules files or use the usual module
black list scheme.

The interesting thing about this is how the boot ordering works, since
rdma-load-modules@.service is a 'before' sysinit.target it will run
before normal system startup tasks if the unit is scheduled to run
early enough. I expect that boot time module loads triggered by udev
will be early enough..

This makes it much closer to normal module loading, instead of being
so strange and should eliminate much of the need for explicit
rdma.service dependencies. The places that need something special,
like srp, can directly depend on their specific module loader:

Requires=rdma-load-modules@srp_daemon

Again, if srp_daemon is scheduled to start during system boot this
should result in the modules being loaded together with the rest of
the modules before sysinit.target.

The one nit that I don't have an easy solution for is starting modules
depending on the device technology, eg not starting srp or ipoib on
!IB devices. The issue is that I can't think of an easy way to detect
the device technology from the udev rule, at least not without a
helper script or additional kernel sysfs..

I havne't been able to test this yet, help would be appreciated.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-07-13 22:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 17:20 [PATCH] Add rdma service for kernel boot support Benjamin Drung
     [not found] ` <20170713172057.25411-1-benjamin.drung-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2017-07-13 17:48   ` Bart Van Assche
     [not found]     ` <1499968101.2740.10.camel-Sjgp3cTcYWE@public.gmane.org>
2017-07-13 18:20       ` Jason Gunthorpe
     [not found]         ` <20170713182018.GE11069-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-07-13 18:33           ` Bart Van Assche
     [not found]             ` <1499970786.2740.17.camel-Sjgp3cTcYWE@public.gmane.org>
2017-07-13 22:15               ` Jason Gunthorpe [this message]
     [not found]                 ` <20170713221520.GA10088-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-07-13 22:36                   ` Bart Van Assche
     [not found]                     ` <1499985409.2740.24.camel-Sjgp3cTcYWE@public.gmane.org>
2017-07-13 22:41                       ` Jason Gunthorpe
     [not found]                         ` <20170713224137.GA24689-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-07-13 22:45                           ` Bart Van Assche
     [not found]                             ` <1499985913.2740.26.camel-Sjgp3cTcYWE@public.gmane.org>
2017-07-13 22:51                               ` Jason Gunthorpe
2017-07-14 10:08                   ` Benjamin Drung
     [not found]                     ` <1500026921.3563.27.camel-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2017-07-14 10:18                       ` Benjamin Drung
2017-07-14 15:55                       ` Jason Gunthorpe
     [not found]                         ` <20170714155544.GA25760-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-07-14 16:23                           ` Benjamin Drung
     [not found]                             ` <1500049393.3563.42.camel-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2017-07-14 16:40                               ` Jason Gunthorpe
     [not found]                                 ` <20170714164029.GA9942-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-07-20  9:04                                   ` Benjamin Drung
     [not found]                                     ` <1500541450.4226.5.camel-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2017-07-21  2:45                                       ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170713221520.GA10088@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=Bart.VanAssche-Sjgp3cTcYWE@public.gmane.org \
    --cc=benjamin.drung-EIkl63zCoXaH+58JC4qpiA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox