From owner-svn-src-head@freebsd.org Mon Jul 18 08:53:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42E5AB9CEF6; Mon, 18 Jul 2016 08:53:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C00115B0; Mon, 18 Jul 2016 08:53:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u6I8ruKx087536 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 18 Jul 2016 01:53:57 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u6I8rugV087535; Mon, 18 Jul 2016 01:53:56 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 18 Jul 2016 01:53:56 -0700 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302894 - head/sys/kern Message-ID: <20160718085356.GO1076@FreeBSD.org> References: <201607150928.u6F9SW3h065100@repo.freebsd.org> <23f60f35-db99-ea20-837b-becd9c5c1887@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <23f60f35-db99-ea20-837b-becd9c5c1887@selasky.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2016 08:53:58 -0000 On Fri, Jul 15, 2016 at 04:29:45PM +0200, Hans Petter Selasky wrote: H> On 07/15/16 11:28, Gleb Smirnoff wrote: H> > Author: glebius H> > Date: Fri Jul 15 09:28:32 2016 H> > New Revision: 302894 H> > URL: https://svnweb.freebsd.org/changeset/base/302894 H> > H> > Log: H> > Fix regression introduced by r302350. The change of return value for a H> > callout that wasn't scheduled at all was unintentional and yielded in H> > several panics. H> > H> > PR: 210884 H> > H> > Modified: H> > head/sys/kern/kern_timeout.c H> > H> > Modified: head/sys/kern/kern_timeout.c H> > ============================================================================== H> > --- head/sys/kern/kern_timeout.c Fri Jul 15 09:23:18 2016 (r302893) H> > +++ head/sys/kern/kern_timeout.c Fri Jul 15 09:28:32 2016 (r302894) H> > @@ -1381,7 +1381,7 @@ again: H> > CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p", H> > c, c->c_func, c->c_arg); H> > CC_UNLOCK(cc); H> > - return (cancelled); H> > + return (0); H> > } H> > H> > c->c_iflags &= ~CALLOUT_PENDING; H> > H> > H> H> Hi, H> H> I think r302894 and r302350 changes the return value of the following H> case, which is not described in the commit message? Is this also a H> regression? H> H> In this revision: H> > https://svnweb.freebsd.org/base/head/sys/kern/kern_timeout.c?view=markup&pathrev=296320 H> H> Assume we enter _callout_stop_safe() having the following assertions: H> H> (c->c_iflags & CALLOUT_PENDING) == 0 (satisfied) H> cc_exec_curr(cc, direct) != c (satisfied) H> H> Then we exit returning (-1). H> H> In this revision: H> > https://svnweb.freebsd.org/base/head/sys/kern/kern_timeout.c?view=markup&pathrev=296320#l1253 H> H> After your changes, entering the same function under the same conditions: H> H> cc_exec_curr(cc, direct) == c (not satisifed) H> (c->c_iflags & CALLOUT_PENDING) == 0 (satisfied) H> H> Then we exit returning (0). H> H> > https://svnweb.freebsd.org/base/head/sys/kern/kern_timeout.c?revision=302894&view=markup#l1384 H> H> If we call callout_stop() on a never scheduled callout, we now get a H> return value of 0 instead of -1, which by manual page definition is H> wrong ???? H> H> Am I wrong? Do others see this too? You are right, the new -1 value was introduced by you and rrs@ in the commit: ------------------------------------------------------------------------ r290664 | rrs | 2015-11-10 06:49:32 -0800 (вт, 10 нояб. 2015) | 6 lines Add new async_drain to the callout system. This is so-far not used but should be used by TCP for sure in its cleanup of the IN-PCB (will be coming shortly). Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D4076 ------------------------------------------------------------------------ So commit not only extended the KPI, but also changed it. And I missed that, using stable/10 version as reference. -- Totus tuus, Glebius.