Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jun 2016 06:35:08 -0700
From:      Mark Johnston <markj@FreeBSD.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Jilles Tjoelker <jilles@stack.nl>, freebsd-current@FreeBSD.org, cem@FreeBSD.org
Subject:   Re: thread suspension when dumping core
Message-ID:  <20160608133508.GA93263@charmander>
In-Reply-To: <20160608043055.GV38613@kib.kiev.ua>
References:  <20160604022347.GA1096@wkstn-mjohnston.west.isilon.com> <20160604093236.GA38613@kib.kiev.ua> <20160606171311.GC10101@wkstn-mjohnston.west.isilon.com> <20160607024610.GI38613@kib.kiev.ua> <20160607041741.GA29017@wkstn-mjohnston.west.isilon.com> <20160607042956.GM38613@kib.kiev.ua> <20160607142452.GA48251@stack.nl> <20160607160155.GP38613@kib.kiev.ua> <20160607211919.GA49961@stack.nl> <20160608043055.GV38613@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 08, 2016 at 07:30:55AM +0300, Konstantin Belousov wrote:
> On Tue, Jun 07, 2016 at 11:19:19PM +0200, Jilles Tjoelker wrote:
> > In this case it is clear which sleep(9) calls should be affected so it
> > may be better to avoid more hidden state.
> In this case yes, but apparently some out-of-tree users exist. And,
> the marking of the single sx_sleep() call depends on knowing our
> implementation. I remember that as the arguments to change from PBDRY to
> the current state setter, in NFS it is not too hard to try to enumerate
> interruptible sleeps. 
> 
> > 
> > I also wonder whether we may be overengineering things here. Perhaps
> > the advlock sleep can simply turn off TDF_SBDRY.
> Well, this was the very first patch suggested.  I would be fine with that,
> but again, out-of-tree code seems to be not quite fine with that local
> solution.

In our particular case, we could possibly use a similar approach. In
general, it seems incorrect to clear TDF_SBDRY if the thread calling
sx_sleep() has any locks held. It is easy to verify that all callers of
lf_advlock() are safe in this respect, but this kind of auditing is
generally hard. In fact, I believe the sx_sleep that led to the problem
described in D2612 is the same as the one in my case. That is, the
sleeping thread may or may not hold a vnode lock depending on context.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160608133508.GA93263>