From owner-svn-src-all@FreeBSD.ORG Tue Sep 10 21:22:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AA537F1A; Tue, 10 Sep 2013 21:22:10 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vc0-x232.google.com (mail-vc0-x232.google.com [IPv6:2607:f8b0:400c:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 32A412D27; Tue, 10 Sep 2013 21:22:10 +0000 (UTC) Received: by mail-vc0-f178.google.com with SMTP id ha12so5391815vcb.37 for ; Tue, 10 Sep 2013 14:22:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=xuLVtUVedbH4m5D12nbCx4EQBmvgMtGElpQc2KHmx64=; b=T/lbv/pNstklLuouMyamChqcrSKloVdvP3R6DAuZU/ecQnQiCb1neM5qlZfM4oV6eJ ijR8ytndcu7fjcTK/s4IXNQCFIl1KPUtE6YPPGq0Am3N5K0DljB5ejvce9iG3NguPYwg 6SHFAgIHj2Q3ZM2SST58wnRr9pJ0vNq3U2vAel6FcQc4qkDw/alcuX3dHGeQIgr/1g1n ++jdEDD6XXCCTsn9tK8Q8/s/WsPswbS48U4hzYWUOGsQhyxMm5t1nipYOs189xePn0A1 YdGynx+Pa+QkU0qr98+dfq+5X1ZL1P43A7WSvCEG+zCblWYRz8M4HHqiBpE11Q6cPrjj 6toA== MIME-Version: 1.0 X-Received: by 10.58.155.68 with SMTP id vu4mr3422359veb.21.1378848129211; Tue, 10 Sep 2013 14:22:09 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.65.132 with HTTP; Tue, 10 Sep 2013 14:22:09 -0700 (PDT) In-Reply-To: References: <201308301039.r7UAduI1052038@svn.freebsd.org> Date: Tue, 10 Sep 2013 23:22:09 +0200 X-Google-Sender-Auth: Z9O8_6Og8XYT8vqLkFWWJlpszY0 Message-ID: Subject: Re: svn commit: r255067 - head/sys/kern From: Davide Italiano To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2013 21:22:10 -0000 On Tue, Sep 10, 2013 at 11:16 PM, Davide Italiano 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