Re: [PATCH 1/3] signal: sys_rt_sigtimedwait: simplify the timeoutlogic

From: Oleg Nesterov
Date: Mon Apr 25 2011 - 13:28:14 EST


On 04/25, Tejun Heo wrote:
>
> On Sat, Apr 23, 2011 at 07:59:22PM +0200, Oleg Nesterov wrote:
> >
> > I don't understand why we are adding (ts.tv_sec || ts.tv_nsec) to
> > timespec_to_jiffies(&ts). Perhaps to ensure we will sleep at least
> > one jiffy if ts != 0? But in this case we should only check tv_nsec,
> > I don't think timespec_to_jiffies() can return zero if tv_sec != 0.
> > In fact I suspect timespec_to_jiffies() can only return zero if
> > tv_sec == tv_nsec == 0 because we add "TICK_NSEC - 1", but I am not
> > sure I understand correctly this math.
> >
> It might be a good idea to note the weird jiffies calculation with a
> comment?

If only I knew what this comment could say except

/* Why do we add (tv_sec || tv_nsec) ? */

I'd better send 4/3 which simply removes this (I hope) unneeded code.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/