From owner-svn-src-head@freebsd.org Tue Aug 16 21:55:35 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 9A98FBBC6C6; Tue, 16 Aug 2016 21:55:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BAF71384; Tue, 16 Aug 2016 21:55:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GLtYRo091233; Tue, 16 Aug 2016 21:55:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GLtYp4091232; Tue, 16 Aug 2016 21:55:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201608162155.u7GLtYp4091232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 16 Aug 2016 21:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304244 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Tue, 16 Aug 2016 21:55:35 -0000 Author: glebius Date: Tue Aug 16 21:55:34 2016 New Revision: 304244 URL: https://svnweb.freebsd.org/changeset/base/304244 Log: We should not be allowing a timeout to reset when a drain is in progress on it (either async or sync drain). At this moment the only user of drain is TCP, but TCP wouldn't reschedule a callout after it has drained it, since it drains only when a tcpcb is closed. This for now the problem isn't observed. Submitted by: rrs Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Tue Aug 16 21:32:05 2016 (r304243) +++ head/sys/kern/kern_timeout.c Tue Aug 16 21:55:34 2016 (r304244) @@ -1061,7 +1061,7 @@ callout_reset_sbt_on(struct callout *c, */ if (c->c_lock != NULL && !cc_exec_cancel(cc, direct)) cancelled = cc_exec_cancel(cc, direct) = true; - if (cc_exec_waiting(cc, direct)) { + if (cc_exec_waiting(cc, direct) || cc_exec_drain(cc, dir)) { /* * Someone has called callout_drain to kill this * callout. Don't reschedule.