From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Bart Van Assche <Bart.VanAssche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"noas-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org"
<noas-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
"benjamin.drung-EIkl63zCoXaH+58JC4qpiA@public.gmane.org"
<benjamin.drung-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>,
"leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
<leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"talatb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org"
<talatb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: rdma-core in Dabian
Date: Fri, 12 May 2017 13:51:04 -0600 [thread overview]
Message-ID: <20170512195104.GA21227@obsidianresearch.com> (raw)
In-Reply-To: <1494613473.14477.12.camel-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
On Fri, May 12, 2017 at 06:24:35PM +0000, Bart Van Assche wrote:
> When using systemd templates instead of the current approach it would
> become cumbersome for users to stop and start the srp_daemon on all ports
> simultaneously.
I think systemd PartOf dependencies is intended to solve that
problem..
PartOf=
Configures dependencies similar to Requires=, but limited
to stopping and restarting of units. When systemd stops or restarts
the units listed here, the action is propagated to this
unit. Note that this is a one-way dependency -- changes to this unit
do not affect the listed units.
So there could still be a service name that covered all of the
children (eg srp_daemon.service and srp_daemon_port@.service)
> Additionally, if an RDMA adapter is hot-added, should the srp_daemon
> be started or should it not be started for the newly added ports?
I'm not sure what is best for that policy..
Today it looks like srp_daemon defaults to explicitly opt-in to
running on ports. To continue that policy the admin would have to
explicitly opt in to each port. Eg perhaps something like:
systemctl enable srp_daemon@mlx4_0/0
Instead of editing a /etc/ config file.
systemd has a '.device' system, which as I understand it, would allow
srp_daemon@mlx4_0/0 to depend on mlx4_0/0.device, which is created by
udev on hotplug, and would trigger running the service.
(perhaps for this reason the template value would be umad0, not mlx4_0/0)
> An in-between program could indeed do the job of listening for udev events
> and actively managing srp_daemon children. Since we already have an
> in-between program, namely srp_daemon.sh, the simplest approach is to modify
> that shell script. Can you have a look at the attached patch?
This seems like a reasonable improvement, but as I said, the inbetween
program is a bit more complex that you probably want to do with a
script:
- Sites do not like things running on timers due to the introduced
jitter, so the trivial sleep loop is not nice.
- Failure of a child should result in a sensible log message and a
restart protocol like systemd has. Failure to SIGTERM the child should
escalate to SIGKILL to prevent lockups during shutdown
- Dumping stderr/etc into /dev/null is a bad idea (eg glibc internal
asserts are lost now). In a systemd world each child should get its
own stderrr logger connection so this stuff works right.
- We still need to be able to configure which ports srp_daemon runs
on and to 'reload' that configuration into the script
- Ideally hot removal of an adaptor requires halting just those
daemons without triggering restart
Since so much of that overlaps with systemd capabilities it does make
some sense to have systemd manage the child processes directly.
For instance you could have the srp_daemon script like in the patch
but replace this:
${prog} -e -c -n [..]
with
systemctl start srp_daemon_port@${hca_id}/${port}
Using PartOf dependencies.. The user experience would be very similar
to the script directly forking, but many more of the above areas are
covered off..
But.. in that case we don't even need the script. If the admin wishes
to run srp_daemon on all IB ports then a simple udev rule will do the
job:
SUBSYSTEM=="infiniband", TAG+="systemd", ATTRS{node_desc}=="*", ENV{SYSTEMD_WANTS}+="srp_daemon_port@$name.service"
[more or less]
And now the timer is gone too.
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
next prev parent reply other threads:[~2017-05-12 19:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-07 6:43 rdma-core in Dabian Leon Romanovsky
[not found] ` <20170507064349.GM22833-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-05-09 17:43 ` Benjamin Drung
[not found] ` <1494351789.3752.5.camel-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2017-05-09 17:54 ` Bart Van Assche
[not found] ` <1494352472.2518.10.camel-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2017-05-09 18:18 ` Jason Gunthorpe
[not found] ` <20170509181807.GB9715-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-05-12 18:24 ` Bart Van Assche
[not found] ` <1494613473.14477.12.camel-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2017-05-12 19:51 ` Jason Gunthorpe [this message]
2017-05-09 18:05 ` Jason Gunthorpe
[not found] ` <20170509180517.GA9715-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-05-10 9:35 ` Benjamin Drung
[not found] ` <1494408947.3739.2.camel-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2017-05-10 15:50 ` Jason Gunthorpe
[not found] ` <20170510155005.GB1007-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-05-10 16:02 ` Leon Romanovsky
[not found] ` <20170510160201.GD1839-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-05-10 16:24 ` Benjamin Drung
2017-05-10 16:33 ` Jason Gunthorpe
[not found] ` <20170510163341.GA25041-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-05-10 16:50 ` Steve Wise
2017-05-10 16:58 ` Jason Gunthorpe
2017-05-10 16:58 ` Leon Romanovsky
[not found] ` <20170510165858.GG1839-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-05-10 18:47 ` Steve Wise
2017-05-10 16:19 ` Benjamin Drung
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=20170512195104.GA21227@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=Bart.VanAssche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org \
--cc=benjamin.drung-EIkl63zCoXaH+58JC4qpiA@public.gmane.org \
--cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=noas-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=talatb-VPRAkNaXOzVWk0Htik3J/w@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;
as well as URLs for NNTP newsgroup(s).