Request for PTY/devfs changes

John Baldwin jhb at freebsd.org
Mon Jan 8 14:59:28 PST 2007


On Monday 08 January 2007 14:29, Poul-Henning Kamp wrote:
> In message <200701081119.39163.jhb at freebsd.org>, John Baldwin writes:
> >On Saturday 06 January 2007 16:36, Ed Schouten wrote:
> 
> >devfs doesn't seem to handle any of this for you at all, forcing each bit
> >of code that uses dev_clone to manage all this itself. :(  When a device
> >is opened you can mark it as opened.  Perhaps you can have a callout that
> >periodically checks to see if there are any "orphans" created due to a
> >stat() and if so schedule a task on a taskqueue to purge them.  I need to
> >figure out something sane for /dev/ipmi0 before I can turn on cloning
> >there myself.
> 
> If the device is entirely virtual, like pty, the driver should not
> allocate any state until open happens and the cdev should be marked
> with CHEAP_CLONE.

Unfortunately the pty uses 'make_dev_cred' with a specific credential and that 
credential reference is what is not getting released.

> In that case the cdev gets recycled quite fast if unreferenced.

How does devfs know to recycle the cdev?  And will it recycle cdev's after 
they are closed?

-- 
John Baldwin


More information about the freebsd-arch mailing list