From owner-freebsd-arch@FreeBSD.ORG Fri Jun 22 19:36:01 2007 Return-Path: X-Original-To: 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 DA28D16A469 for ; Fri, 22 Jun 2007 19:36:01 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id A977C13C45E for ; Fri, 22 Jun 2007 19:36:01 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 54454 invoked from network); 22 Jun 2007 15:20:05 -0000 Received: from ppp-71-139-42-13.dsl.snfc21.pacbell.net (HELO ?10.0.0.15?) (nate-mail@71.139.42.13) by root.org with ESMTPA; 22 Jun 2007 15:20:05 -0000 Message-ID: <467BE89F.9090302@root.org> Date: Fri, 22 Jun 2007 08:19:59 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.0 (X11/20070511) MIME-Version: 1.0 To: Andriy Gapon References: <1182140582.00760687.1182127202@10.7.7.3> <1182453789.00762635.1182442802@10.7.7.3> <1182468188.00762718.1182456601@10.7.7.3> <1182482583.00762779.1182469202@10.7.7.3> <467B8732.60503@icyb.net.ua> In-Reply-To: <467B8732.60503@icyb.net.ua> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: 7bit Cc: arch@freebsd.org, lars.engels@0x20.net, Ariff Abdullah Subject: Re: patch: acpi usermode suspend API change 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: Fri, 22 Jun 2007 19:36:01 -0000 Andriy Gapon wrote: > on 22/06/2007 02:33 Ariff Abdullah said the following: >> Same issue with sound devices as well, but I've managed to solve it by >> implementing own clone manager which require tiny hook into open() and >> close() along with garbage collector and ability to handle various >> abusive behaviour (while : ; ls /dev/xxx ; done, etc). See >> sys/dev/sound/clone.* . It should be generic enough. > > Maybe I'll say something stupid - I haven't looked at any code nor I > have any patches of my own, but wouldn't it be possible to manage cloned > devices similarly to how file descriptors are managed ? That is, don't > leave unused devices behind, re-use lowest available device id, etc. > I think that this would be a right thing. There are still resource exhaustion issues with that simple approach. Since each copy of my device is single-open, I can refuse the 2nd and future processes that try to open the same device. -- Nate