From owner-freebsd-current@FreeBSD.ORG Fri Jun 22 16:50:06 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 290EC1065670; Fri, 22 Jun 2012 16:50:06 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 786E48FC12; Fri, 22 Jun 2012 16:50:05 +0000 (UTC) Received: by bkvi18 with SMTP id i18so2223800bkv.13 for ; Fri, 22 Jun 2012 09:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=BwJSLh0E5QeXB8DrHI1ZGi1Hi4pLoYZvKZ07MaNb73k=; b=IsEoOrejxwp/swQ6nRab7bW2WEEGnpnDxngpog5MYLOAR0M/o0wfGk67EMhOaM44XD veyXQtepOBJCqOC6YZEE93a5nDPJwGex8/gKXxYKtSezQ8k0hZulDfd8ZE+RP/k+YnUL 73BAnB/mlQFTdEi3FgVNOXSfDfRh54A5r/UIXqF726t+Nco6bTJ79q2/ai3iOzuKXXvJ 5wKLZbyegAzye/tHuHfCdVp211GrI/pQjrJ1qvZYl6DH2smp1pPBHY5zJ7YKen9YPYo/ 0t/Qh48wyOCkIDkciHOSfnIg3lTh4XzkxQQdG+ZX80YYNW0eR6MTo+TWtTOMkj6wlA7Y J2VA== Received: by 10.152.46.6 with SMTP id r6mr2853236lam.7.1340383804500; Fri, 22 Jun 2012 09:50:04 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id fd1sm21246055lbb.7.2012.06.22.09.50.02 (version=SSLv3 cipher=OTHER); Fri, 22 Jun 2012 09:50:03 -0700 (PDT) Sender: Alexander Motin Message-ID: <4FE4A239.5030000@FreeBSD.org> Date: Fri, 22 Jun 2012 19:50:01 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120618 Thunderbird/13.0 MIME-Version: 1.0 To: "Kenneth D. Merry" Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Fri, 22 Jun 2012 16:50:06 -0000 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. -- Alexander Motin