From owner-freebsd-arch@FreeBSD.ORG Wed Aug 31 16:46:29 2011 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A845106564A; Wed, 31 Aug 2011 16:46:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 78D4C8FC0C; Wed, 31 Aug 2011 16:46:28 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA23253; Wed, 31 Aug 2011 19:46:23 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4E5E655E.8060505@FreeBSD.org> Date: Wed, 31 Aug 2011 19:46:22 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110705 Thunderbird/5.0 MIME-Version: 1.0 To: Warner Losh References: <4E53986B.5000804@FreeBSD.org> <4E5A099F.4060903@FreeBSD.org> <201108281127.44696.hselasky@freebsd.org> <201108310943.24476.jhb@freebsd.org> <4E5E5DA0.4060003@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Hans Petter Selasky , John Baldwin , freebsd-arch@FreeBSD.org Subject: Re: skipping locks, mutex_owned, usb X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 16:46:29 -0000 on 31/08/2011 19:32 Warner Losh said the following: > > On Aug 31, 2011, at 10:13 AM, Andriy Gapon wrote: >> So why the mutex unwinding/rewinding code is present at all? >> What kind of situations is it supposed to prevent? >> >> Personally I think that we either know that those drivers should not hold the >> locks in question (bus_mtx and xfer_mtx) or we know that they hold them. >> I do not see why we have to be conditional here or have a loop even... > > Today, I think we know these things. In the past, as the code was written, there was a lot more special case code needed for giant cohabitation. Since you chimed in... :-) I have a hard time imagining a situation where that code is useful today or was useful before. Any example, purely hypothetical even, would do. -- Andriy Gapon