Re: devctl (alike?) for devfs

2008-05-14 Thread Kostik Belousov
On Tue, May 13, 2008 at 11:40:21PM +0300, Andriy Gapon wrote: on 13/05/2008 22:16 Kostik Belousov said the following: I looked at your previous patch, and it seems it is much simpler to do drop the devmtx once more then to try to abuse free lists. In the destroy_devl(), after the

Re: devctl (alike?) for devfs

2008-05-14 Thread Andriy Gapon
on 14/05/2008 15:19 Kostik Belousov said the following: On Tue, May 13, 2008 at 11:40:21PM +0300, Andriy Gapon wrote: on 13/05/2008 22:16 Kostik Belousov said the following: I looked at your previous patch, and it seems it is much simpler to do drop the devmtx once more then to try to abuse

Re: devctl (alike?) for devfs

2008-05-13 Thread Andriy Gapon
on 13/05/2008 22:04 Andriy Gapon said the following: on 12/05/2008 00:48 Kostik Belousov said the following: No, we do not have a leak, but we have somewhat non-obvious behaviour. The cdev structure is freed only after the last reference to cdev is gone. Typical holder of the reference is the

Re: devctl (alike?) for devfs

2008-05-13 Thread Kostik Belousov
On Tue, May 13, 2008 at 10:04:56PM +0300, Andriy Gapon wrote: on 12/05/2008 00:48 Kostik Belousov said the following: No, we do not have a leak, but we have somewhat non-obvious behaviour. The cdev structure is freed only after the last reference to cdev is gone. Typical holder of the

Re: devctl (alike?) for devfs

2008-05-13 Thread Andriy Gapon
on 12/05/2008 00:48 Kostik Belousov said the following: No, we do not have a leak, but we have somewhat non-obvious behaviour. The cdev structure is freed only after the last reference to cdev is gone. Typical holder of the reference is the devfs vnode. In the normal usage, the vnode is present

Re: devctl (alike?) for devfs

2008-05-13 Thread Andriy Gapon
on 13/05/2008 22:16 Kostik Belousov said the following: I looked at your previous patch, and it seems it is much simpler to do drop the devmtx once more then to try to abuse free lists. In the destroy_devl(), after the while (dev-si_threadcount != 0) { /* Use unique

Re: devctl (alike?) for devfs

2008-05-11 Thread Andriy Gapon
Kostik, John, Warner, thank you for your guidance and suggestions. I am currently testing the patch attached and I am using a kernel with WITNESS and INVARIANTS enabled. Scope of my testing is plugging/unplugging of UMASS devices. I get CREATE notifications all right. I do not get any

Re: devctl (alike?) for devfs

2008-05-11 Thread Kostik Belousov
On Sun, May 11, 2008 at 11:50:20PM +0300, Andriy Gapon wrote: Kostik, John, Warner, thank you for your guidance and suggestions. I am currently testing the patch attached and I am using a kernel with WITNESS and INVARIANTS enabled. Scope of my testing is plugging/unplugging of UMASS

Re: devctl (alike?) for devfs

2008-04-26 Thread M. Warner Losh
In message: [EMAIL PROTECTED] : However it is possible that it did something wrong - at that time I had : devctl calls in kern_conf. I'd be inclined to say 'create' and 'destroy' for the events. ATTACH and DETACH are typically reserved for device driver events, not for device node events.

Re: devctl (alike?) for devfs

2008-04-25 Thread Kostik Belousov
On Fri, Apr 25, 2008 at 12:35:26AM +0300, Andriy Gapon wrote: I decided to do it in devfs_devs.c because there are less entry points there and the code is much simpler (you know: aliases, clones). I also had to add !cold condition, because apparently we have devices created so early in the

Re: devctl (alike?) for devfs

2008-04-25 Thread Andriy Gapon
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. Kostik, I tried this patch only

Re: devctl (alike?) for devfs

2008-04-25 Thread Kostik Belousov
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

Re: devctl (alike?) for devfs

2008-04-25 Thread Andriy Gapon
on 25/04/2008 17:36 Kostik Belousov said the following: 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()

Re: devctl (alike?) for devfs

2008-04-24 Thread Andriy Gapon
on 24/04/2008 01:39 Andriy Gapon said the following: on 23/04/2008 22:49 John Baldwin said the following: Events have a subsystem associated with them, so devfs events would use their own subsystem type to avoid that sort of confusion. Thank you for straightening me - for some reason I

Re: devctl (alike?) for devfs

2008-04-24 Thread John Baldwin
On Thursday 24 April 2008 04:05:10 am Andriy Gapon wrote: on 24/04/2008 01:39 Andriy Gapon said the following: on 23/04/2008 22:49 John Baldwin said the following: Events have a subsystem associated with them, so devfs events would use their own subsystem type to avoid that sort of

Re: devctl (alike?) for devfs

2008-04-24 Thread Andriy Gapon
I decided to do it in devfs_devs.c because there are less entry points there and the code is much simpler (you know: aliases, clones). I also had to add !cold condition, because apparently we have devices created so early in the boot, that devctl is not ready to handle a notification. My system

Re: devctl (alike?) for devfs

2008-04-23 Thread Andriy Gapon
on 23/04/2008 00:06 Jille said the following: Andriy Gapon wrote: Maybe this is a crazy idea or maybe we already have something like this. Is it possible to get notifications about changes in devfs - appearance and disappearance of devices (in devfs sense of the word)? devctl currently

Re: devctl (alike?) for devfs

2008-04-23 Thread John Baldwin
On Tuesday 22 April 2008 03:54:17 pm Andriy Gapon wrote: Maybe this is a crazy idea or maybe we already have something like this. Is it possible to get notifications about changes in devfs - appearance and disappearance of devices (in devfs sense of the word)? devctl currently notifies about

Re: devctl (alike?) for devfs

2008-04-23 Thread Andriy Gapon
on 23/04/2008 16:55 John Baldwin said the following: On Tuesday 22 April 2008 03:54:17 pm Andriy Gapon wrote: Maybe this is a crazy idea or maybe we already have something like this. Is it possible to get notifications about changes in devfs - appearance and disappearance of devices (in devfs

Re: devctl (alike?) for devfs

2008-04-23 Thread John Baldwin
On Wednesday 23 April 2008 03:25:23 pm Andriy Gapon wrote: on 23/04/2008 16:55 John Baldwin said the following: On Tuesday 22 April 2008 03:54:17 pm Andriy Gapon wrote: Maybe this is a crazy idea or maybe we already have something like this. Is it possible to get notifications about changes

Re: devctl (alike?) for devfs

2008-04-23 Thread Andriy Gapon
on 23/04/2008 22:49 John Baldwin said the following: Events have a subsystem associated with them, so devfs events would use their own subsystem type to avoid that sort of confusion. Thank you for straightening me - for some reason I was thinking about +/- (attach/detach) events, but I see

devctl (alike?) for devfs

2008-04-22 Thread Andriy Gapon
Maybe this is a crazy idea or maybe we already have something like this. Is it possible to get notifications about changes in devfs - appearance and disappearance of devices (in devfs sense of the word)? devctl currently notifies about real (hardware) devices handled by device drivers and some

Re: devctl (alike?) for devfs

2008-04-22 Thread Jille
Andriy Gapon wrote: Maybe this is a crazy idea or maybe we already have something like this. Is it possible to get notifications about changes in devfs - appearance and disappearance of devices (in devfs sense of the word)? devctl currently notifies about real (hardware) devices handled by