svn commit: r255067 - head/sys/kern

Davide Italiano davide at freebsd.org
Tue Sep 10 21:22:10 UTC 2013


On Tue, Sep 10, 2013 at 11:16 PM, Davide Italiano <davide at freebsd.org> wrote:
>> ==============================================================================
>> --- head/sys/kern/kern_synch.c  Fri Aug 30 10:10:22 2013        (r255066)
>> +++ head/sys/kern/kern_synch.c  Fri Aug 30 10:39:56 2013        (r255067)
>> @@ -356,10 +356,7 @@ msleep_spin_sbt(void *ident, struct mtx
>>  int
>>  pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags)
>>  {
>> -       int sbt_sec;
>> -
>> -       sbt_sec = sbintime_getsec(sbt);
>> -       KASSERT(sbt_sec >= 0, ("pause: timo must be >= 0"));
>> +       KASSERT(sbt >= 0, ("pause: timeout must be >= 0"));
>>
>
> Hi Hans,
> sorry for the late answer/review but I completely missed this patch
> when you posted on mailing lists.
> That said, I think this commit is correct and also makes the code more
> readable. As an added bonus, this fixes a "bug" introduced while
> hacking on callout rejuvenation. The original assertion was actually
> checking for timo  >= 0 but when we switched to 'struct bintime' for
> callout that assertion was changed to check for bt.sec >=0. After
> that, when we introduced sbintime_t that assertion was never changed
> back to his original form, which is more correct. Also, the assertion
> message is more explicative, at least IMHO.
>
> Thanks,
>
> --
> Davide
>
> "There are no solved problems; there are only problems that are more
> or less solved" -- Henri Poincare

I've just noticed the comment just before pause_sbt() still refers to
pause() function and should be rephrased to reflect the new world
order, if you're interested in seeing this fixed.

Thanks,

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare


More information about the svn-src-head mailing list