From owner-freebsd-current@FreeBSD.ORG Sun Jun 24 04:33:15 2012 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 230CD1065670; Sun, 24 Jun 2012 04:33:15 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id DFB698FC08; Sun, 24 Jun 2012 04:33:14 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id q5O4X8WA080037; Sat, 23 Jun 2012 22:33:08 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id q5O4X8Wq080036; Sat, 23 Jun 2012 22:33:08 -0600 (MDT) (envelope-from ken) Date: Sat, 23 Jun 2012 22:33:08 -0600 From: "Kenneth D. Merry" To: Alexander Motin Message-ID: <20120624043308.GA78807@nargothrond.kdm.org> References: <4FE4A239.5030000@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FE4A239.5030000@FreeBSD.org> User-Agent: Mutt/1.4.2i Cc: FreeBSD current Subject: Re: minor GEOM disk API change coming X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 04:33:15 -0000 On Fri, Jun 22, 2012 at 19:50:01 +0300, Alexander Motin wrote: > Hi. > > I understand problem you are going to fix and I think your patch should > do it. What I don't very like is addition of new GEOM method. Now GEOM > doesn't need it because all internal open/close operations and provider > destructions there protected by the topology SX lock. Unluckily that > lock doesn't cover g_wither_provider(), called by disk_gone() while > holding CAM SIM lock. If not that SIM lock, it would be enough to just > grab and drop GEOM topology lock to ensure that no new open() calls will > follow. Indirect way to do it could be to post GEOM event that would > drop the reference as soon as it will be handled and can obtain the > topology lock. Unluckily it uses malloc() for event storage and also can > be unreliable if called from under the SIM mutex lock. So it seems many > things would be much easier if it was possible to drop SIM lock inside > periph invalidate method, but now it is unsafe > > That is not an objection, just some thoughts about. Yeah, there are things in CAM (and GEOM) that need to be cleaned up. I wouldn't have added a GEOM method if there were a reasonable way around it, but as you pointed out, there isn't right now. I committed the patch, and plan to merge it to stable/9. Ken -- Kenneth Merry ken@FreeBSD.ORG