Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Apr 2008 17:36:46 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Andriy Gapon <avg@icyb.net.ua>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: devctl (alike?) for devfs
Message-ID:  <20080425143646.GF18958@deviant.kiev.zoral.com.ua>
In-Reply-To: <4811E6BC.4060306@icyb.net.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>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080425143646.GF18958>