Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Oct 2018 11:57:53 -0700
From:      John Baldwin <jhb@FreeBSD.org>
To:        "Jonathan T. Looney" <jtl@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r339251 - in head/sys: net netinet netinet6
Message-ID:  <d4887528-dd25-7500-9afc-d79af38781ee@FreeBSD.org>
In-Reply-To: <CADrOrmviC-%2BVz3PMM0yA1=VRwhKnY6Kkv8aG=nFE=VYPL8mZyQ@mail.gmail.com>
References:  <201810091326.w99DQ7MN083891@repo.freebsd.org> <bb0f4bca-8cca-f2c2-f8d8-5a8ee548d3ef@FreeBSD.org> <CADrOrmviC-%2BVz3PMM0yA1=VRwhKnY6Kkv8aG=nFE=VYPL8mZyQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/9/18 8:36 AM, Jonathan T. Looney wrote:
> On Tue, Oct 9, 2018 at 11:02 AM John Baldwin <jhb@freebsd.org <mailto:jhb@freebsd.org>> 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

                                                                            



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d4887528-dd25-7500-9afc-d79af38781ee>