From owner-freebsd-arch@FreeBSD.ORG Mon Jan 8 22:59:28 2007 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B9BC16A580 for ; Mon, 8 Jan 2007 22:59:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id BCAAD13C448 for ; Mon, 8 Jan 2007 22:59:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id l08MxKvh069768; Mon, 8 Jan 2007 17:59:21 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: "Poul-Henning Kamp" Date: Mon, 8 Jan 2007 17:50:58 -0500 User-Agent: KMail/1.9.1 References: <23673.1168284542@critter.freebsd.dk> In-Reply-To: <23673.1168284542@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200701081750.59131.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 08 Jan 2007 17:59:24 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2424/Mon Jan 8 11:46:49 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Ed Schouten , freebsd-arch@freebsd.org Subject: Re: Request for PTY/devfs changes X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jan 2007 22:59:28 -0000 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