Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Jan 2007 19:29:02 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Ed Schouten <ed@fxq.nl>, freebsd-arch@freebsd.org
Subject:   Re: Request for PTY/devfs changes 
Message-ID:  <23673.1168284542@critter.freebsd.dk>
In-Reply-To: Your message of "Mon, 08 Jan 2007 11:19:38 EST." <200701081119.39163.jhb@freebsd.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
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.

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

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



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