From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 14:37:00 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27B091065677; Fri, 25 Apr 2008 14:37:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by mx1.freebsd.org (Postfix) with ESMTP id 9C6638FC15; Fri, 25 Apr 2008 14:36:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=skuns.kiev.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JpP2n-000IUa-Ti; Fri, 25 Apr 2008 17:36:58 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by skuns.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3PEaqws023265 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 25 Apr 2008 17:36:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3PEalua078532; Fri, 25 Apr 2008 17:36:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m3PEakEE078531; Fri, 25 Apr 2008 17:36:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 25 Apr 2008 17:36:46 +0300 From: Kostik Belousov To: Andriy Gapon Message-ID: <20080425143646.GF18958@deviant.kiev.zoral.com.ua> References: <480E4269.2090604@icyb.net.ua> <480FBAB9.1000904@icyb.net.ua> <48103F36.6060707@icyb.net.ua> <200804240811.26183.jhb@freebsd.org> <4810FD1E.70602@icyb.net.ua> <20080425095009.GD18958@deviant.kiev.zoral.com.ua> <4811E6BC.4060306@icyb.net.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Yc07lwn3HUDqPfE2" Content-Disposition: inline In-Reply-To: <4811E6BC.4060306@icyb.net.ua> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua X-Scanner-Signature: 1118cf21f7425d415ed61e91afc5cb63 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 2723 [Apr 25 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {received from trusted relay: not dialup} X-SpamTest-Method: none X-SpamTest-Method: Local Lists X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release Cc: freebsd-hackers@freebsd.org Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 14:37:00 -0000 --Yc07lwn3HUDqPfE2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 25, 2008 at 05:12:12PM +0300, Andriy Gapon wrote: > on 25/04/2008 12:50 Kostik Belousov said the following: > >Did you run this with WITNESS ? > > > >You put the whole devctl_notify() call under the dev_mtx. This includes > >the malloc(), PROC_LOCK() and signalling, and some internal devctl_queue= () > >stuff. This is wrong. >=20 > Kostik, >=20 > I tried this patch only with my working (non-debug) configuration. > I will try with WITNESS. > You think that acquiring all those locks while holding dev_mtx is bad? > I can try to place devctl_notify calls in make_dev_credv, make_dev_alias= =20 > and destroy_dev. The problem that I see is that destroy_devl ('l' at the= =20 > end) calls itself recursively for child devices, this is all done under= =20 > dev_mtx. So I am not sure how to call devctl_notify for those child=20 > devices properly. The malloc and free cannot be called while holding dev_mtx, this causes the LORs. Please, look at the rev. 1.207, 1.210 of the kern/kern_conf.c for the workarounds for the malloc issues. It seems that you may abuse the dev_unlock_and_free() to make the notifications. Also, I think it is wrong to establish the lock ordering relations between the process subsystem and cdev. --Yc07lwn3HUDqPfE2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAkgR7H0ACgkQC3+MBN1Mb4jLJACg5zBTTG2ns1TaqjSQM7QhXRcI OUEAnjzCEmI2MlE2YOTyhJSYgUIhUD60 =HMoF -----END PGP SIGNATURE----- --Yc07lwn3HUDqPfE2--