From owner-svn-src-all@freebsd.org Tue Oct 9 18:57:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 932E110B877C; Tue, 9 Oct 2018 18:57:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36B19776D2; Tue, 9 Oct 2018 18:57:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 12C2D10B707; Tue, 9 Oct 2018 14:57:54 -0400 (EDT) Subject: Re: svn commit: r339251 - in head/sys: net netinet netinet6 To: "Jonathan T. Looney" References: <201810091326.w99DQ7MN083891@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: Date: Tue, 9 Oct 2018 11:57:53 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 09 Oct 2018 14:57:56 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 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, 09 Oct 2018 18:57:57 -0000 On 10/9/18 8:36 AM, Jonathan T. Looney wrote: > On Tue, Oct 9, 2018 at 11:02 AM John Baldwin > wrote: > > Do we have some sort of simple per-thread epoch counter similar to > td->td_locks that we could assert on in userret() and in the ithread loop > when ithreads go to sleep to help catch leaked locks? > > > Yes: td->td_epochnest. > > There are already INVARIANTS checks in malloc (for M_WAITOK),  userret(), and _sleep(). I think that covers the cases you mentioned. However, I am very much in favor of adding any additional checks which make sense. The one that would matter in this case would be idle ithreads. We have some existing checks (WITNESS_WARN) in ithread_loop() already. We should add a td_epochnest assertion next to that line I think. -- John Baldwin