Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Sep 2013 23:22:09 +0200
From:      Davide Italiano <davide@freebsd.org>
To:        Hans Petter Selasky <hselasky@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r255067 - head/sys/kern
Message-ID:  <CACYV=-GS3SgiYJkzi-bCsqerZmcfm25k8z6o0HqibZ%2B8cH7Nrg@mail.gmail.com>
In-Reply-To: <CACYV=-Gd3ip%2BukcNfwCUOVZ%2BySKLsY3-AD5=f3naHuKhYu9Uew@mail.gmail.com>
References:  <201308301039.r7UAduI1052038@svn.freebsd.org> <CACYV=-Gd3ip%2BukcNfwCUOVZ%2BySKLsY3-AD5=f3naHuKhYu9Uew@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 10, 2013 at 11:16 PM, Davide Italiano <davide@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACYV=-GS3SgiYJkzi-bCsqerZmcfm25k8z6o0HqibZ%2B8cH7Nrg>