Date: Mon, 8 Jan 2007 17:50:58 -0500 From: John Baldwin <jhb@freebsd.org> To: "Poul-Henning Kamp" <phk@phk.freebsd.dk> Cc: Ed Schouten <ed@fxq.nl>, freebsd-arch@freebsd.org Subject: Re: Request for PTY/devfs changes Message-ID: <200701081750.59131.jhb@freebsd.org> In-Reply-To: <23673.1168284542@critter.freebsd.dk> References: <23673.1168284542@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 08 January 2007 14:29, Poul-Henning Kamp wrote: > In message <200701081119.39163.jhb@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701081750.59131.jhb>