From owner-freebsd-current@freebsd.org Wed Jun 8 14:22:38 2016 Return-Path: <owner-freebsd-current@freebsd.org> Delivered-To: freebsd-current@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 A8F69B6F365 for <freebsd-current@mailman.ysv.freebsd.org>; Wed, 8 Jun 2016 14:22:38 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51D5C1120; Wed, 8 Jun 2016 14:22:38 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-wm0-x22e.google.com with SMTP id k204so19538060wmk.0; Wed, 08 Jun 2016 07:22:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=iiuyq+xI/JjEkJSUVtW5aE9VGU6ti/CMfgq4s564xkc=; b=YyiZkVDfroSuLQmiQh8GKijLByt3sE7382BNbKYBbE63pL8gQkuA5zjpYpRlLLT6C5 +DCQkyHY9IEEavgwrH9vmcDsw5032uBF5md/O7XuLI/f3kZmfHX7z5kihhMXg2NlSBrL U5h45ciKJ9W+wLp86s5/+UMB8bSE7kelEeK9R1Ek+AtIWKRBXuqpIcPKEAbG9HlxGaGq 65mzHlcVSDEDILzg3sFw/3lgeitIWjElz1krVrPKCgKdIXDb+enWuU8aWy/Fq7LMfvZU xQAyBXOHL7jYOguyRmv7Ky4O06gMfZ2wCkvef42gSlwp5o5xcLkRyoA7bgy+Cn3CO8bv Lo2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=iiuyq+xI/JjEkJSUVtW5aE9VGU6ti/CMfgq4s564xkc=; b=bAqPt10fV0ds9pDL3wlO6teKKDOrfCoZ+pxfwDrXCZ9XMSf1pnDQFg3wPH5DJFLAUI P8Lk/0boRko5m8Vjfumjo4GqU30D7m4eFIfySl1oSpFpO30p5Ht0ou3KLQQYQTCtrFfw 39xc/tke7WB/1D+GdfX4XL9tTptYuCddjW+/av2z92EbBGuMSbwhbw6TaeSJzu7NtWpQ pmrhhMO1bcxf0RJs+7QJkB2xIquO9U4MKJV2PvSV3muiA7aXiX5HiejCvttHB3N8lUmc fqI4VabN7OKRbTbcaUVwkUiawEwrzmb7p9V8lLgmpt2h162aydmJpmXHvG5LMQ8gEcCm v3qg== X-Gm-Message-State: ALyK8tIiAdVm/qQnT1Ob6e8Asige1CKCO7SfwhhOEplz7nUcQKL2bCDklZrak0g09yDXug== X-Received: by 10.194.107.39 with SMTP id gz7mr5562204wjb.36.1465395756860; Wed, 08 Jun 2016 07:22:36 -0700 (PDT) Received: from charmander ([137.122.64.8]) by smtp.gmail.com with ESMTPSA id y3sm1752295wji.40.2016.06.08.07.22.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jun 2016 07:22:36 -0700 (PDT) Sender: Mark Johnston <markjdb@gmail.com> Date: Wed, 8 Jun 2016 07:22:31 -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: <20160608142231.GB93263@charmander> References: <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> <20160608133508.GA93263@charmander> <20160608135635.GY38613@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160608135635.GY38613@kib.kiev.ua> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussions about the use of FreeBSD-current <freebsd-current.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-current>, <mailto:freebsd-current-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current/> List-Post: <mailto:freebsd-current@freebsd.org> List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-current>, <mailto:freebsd-current-request@freebsd.org?subject=subscribe> X-List-Received-Date: Wed, 08 Jun 2016 14:22:38 -0000 On Wed, Jun 08, 2016 at 04:56:35PM +0300, Konstantin Belousov wrote: > On Wed, Jun 08, 2016 at 06:35:08AM -0700, Mark Johnston wrote: > > 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: > > > > 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. > > I do not think that in-tree code sleeps with a vnode lock held in > the lf_advlock(). Otherwise, system would hang in lock cascade by > an attempt to obtain an advisory lock. I think we can even assert > this with witness. Indeed. I just meant that this appears to not be true of Isilon's FS locking code, which is parameterized heavily by the lock type. > > There is another sleep, which Jilles mentioned, in lf_purgelocks(), > called from vgone(). This sleep indeed occurs under the vnode lock, and > as such must be non-suspendable. The sleep waits until other threads > leave the lf_advlock() for the reclaimed vnode, and they should leave in > deterministic time due to issued wakeups. So this sleep is exempt from > the considerations, and TDF_SBDRY there is correct. > > I am fine with either the braces around sx_sleep() in lf_advlock() to > clear TDF_SBDRY (sigdeferstsop()), or with the latest patch I sent, > which adds temporal override for TDF_SBDRY with TDF_SRESTART. My > understanding is that you prefer the later. If I do not mis-represent > your position, I understand why you do prefer that. Right, I think it would be hard for me to adopt a solution based on the proposed lf_advlock() change. So I prefer the latter, more general approach, additional complexity notwithstanding.