From owner-svn-src-all@FreeBSD.ORG Tue Sep 10 21:16:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 16B37D41; Tue, 10 Sep 2013 21:16:40 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-ve0-x22d.google.com (mail-ve0-x22d.google.com [IPv6:2607:f8b0:400c:c01::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A5502CAF; Tue, 10 Sep 2013 21:16:39 +0000 (UTC) Received: by mail-ve0-f173.google.com with SMTP id cz12so4914967veb.4 for ; Tue, 10 Sep 2013 14:16:38 -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=1V2xiV+JcTbwaIWy5NQZ/Ex3WfYQkDTG56yzoeARpJc=; b=yUztzZJ3yr+E9lsJIpba6sZoiNQuKxq0D+S5ygDKNfA2m25AmKgLGQVyHrWhzok9bO RR5oLEENgxU2oT1IOI8uk0ZNVlqFdxDOZkRRNdnlaF+/tEm6BRpjXNf2ZZvHNr5lw+NA XSqXeG9gwN+rhQAkn3mEr/K344VJByPudNbj+PbcRcJEQ2KCRGeOnGbgUTyZB4+hL3uT cnf41wBI3FnZtElX8wDEUT0lxlq/s6HiY9EUNChRSKJmWz6sZ5VAR4/SV2oej3YZMFRU WPzrx9UR2FaurDTQvhQQmeOdRCta2PtfO6XJkxpM8iUSkbiwBqoFja7dwBx96KPWoWyS ue0Q== MIME-Version: 1.0 X-Received: by 10.220.10.194 with SMTP id q2mr24383404vcq.2.1378847798735; Tue, 10 Sep 2013 14:16:38 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.65.132 with HTTP; Tue, 10 Sep 2013 14:16:38 -0700 (PDT) In-Reply-To: <201308301039.r7UAduI1052038@svn.freebsd.org> References: <201308301039.r7UAduI1052038@svn.freebsd.org> Date: Tue, 10 Sep 2013 23:16:38 +0200 X-Google-Sender-Auth: PG5w4v8djNCv-qPqXFINWQumoG8 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:16:40 -0000 > ============================================================================== > --- 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