[dm-devel] [PATCH] multipathd: use nanosleep for sleeping

Martin Wilck mwilck at suse.com
Wed Mar 7 14:26:30 UTC 2018


On Tue, 2018-03-06 at 19:21 -0600, Benjamin Marzinski wrote:
> On Tue, Mar 06, 2018 at 09:37:13PM +0100, Martin Wilck wrote:
> > 
> > I'm sure this works, but have you considered achieving the same
> > result
> > simply by using create_timer with a different signal than SIGALRM?
> > Thinking about it, I'm sure the strict_timing code can be
> > drastically
> > simplified by using an interval timer and a realtime signal.
> 
> I don't see how it could get much simpler, and all things being
> equal,
> I'd rather that multipathd did less with signals. But if you want to
> redo this with a timer, I don't haven any strong feelings against it.

I just sent it with the subject "[RFC PATCH] multipathd: strict_timing
without signals". Please have a look. The patch actually does two
different things - a) convert the current setitimer-based code to a
custom timer that works without SIGALRM (without any explicit signal,
actually), and b) use the it_interval field to wakeup automatically at
fixed intervals, rather than re-calculate the wait time from tick to
tick. 

Whether or not this is simpler than the current code (or your approach,
for that matter) is up to personal judgement. My patch has a positive
line count, but it requires less code inside the checkerloop itself.

Cheers,
Martin

-- 
Dr. Martin Wilck <mwilck at suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)




More information about the dm-devel mailing list