From owner-freebsd-arch@FreeBSD.ORG Mon Jan 8 19:29:07 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 D339416A415 for ; Mon, 8 Jan 2007 19:29:07 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 7A87A13C441 for ; Mon, 8 Jan 2007 19:29:07 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 7D3BB1747B; Mon, 8 Jan 2007 19:29:05 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.13.8/8.13.8) with ESMTP id l08JT26E023674; Mon, 8 Jan 2007 19:29:02 GMT (envelope-from phk@critter.freebsd.dk) To: John Baldwin From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 08 Jan 2007 11:19:38 EST." <200701081119.39163.jhb@freebsd.org> Date: Mon, 08 Jan 2007 19:29:02 +0000 Message-ID: <23673.1168284542@critter.freebsd.dk> Sender: phk@critter.freebsd.dk 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 19:29:07 -0000 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.