From owner-cvs-src@FreeBSD.ORG Sat Aug 9 21:02:05 2008 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D6E21065671; Sat, 9 Aug 2008 21:02:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 075588FC0C; Sat, 9 Aug 2008 21:02:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [IPv6:2001:470:1f11:75:2a0:d2ff:fe18:8b38]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m79L1w7K043547; Sat, 9 Aug 2008 17:01:58 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Peter Jeremy Date: Sat, 9 Aug 2008 15:43:14 -0400 User-Agent: KMail/1.9.7 References: <200808081343.m78DhwYE068477@repoman.freebsd.org> <200808081226.32089.jhb@freebsd.org> <20080809001256.GL64458@server.vk2pj.dyndns.org> In-Reply-To: <20080809001256.GL64458@server.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808091543.15299.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:2001:470:1f11:75::1]); Sat, 09 Aug 2008 17:01:58 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/7995/Sat Aug 9 14:55:20 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: cvs-src@freebsd.org, src-committers@freebsd.org, Ed Schouten , cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/dev/io iodev.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2008 21:02:05 -0000 On Friday 08 August 2008 08:12:56 pm Peter Jeremy wrote: > On 2008-Aug-08 12:26:31 -0400, John Baldwin wrote: > >It should be setting D_TRACKCLOSE though so that close() reliably clears > > the flag even in single-threaded processes. You can still get odd > > behavior if you explicitly open it twice in an app and then close one of > > the two fd's. You will no longer have IO permission even though you still > > have one fd open. However, if you do that I think you deserve what you > > asked for. :) > > That behaviour may be legitimate: Your code links with libraries foo and > bar that each independently open /dev/io so they can frob different things > in IO space. libfoo needs ongoing access to device foo and so keeps its > descriptor open. libbar only needs once-off access to device bar and so > closes /dev/io once it's finished its initialisation. Libraries foo and > bar are completely independent and shouldn't need to know anything about > each other and your app shouldn't need to know that libraries it's using > frob around in IO space. Then it requires a per-thread (really per-process) counter. However, D_TRACKCLOSE is still better than what is there now and will be needed for the counter case to have a chance of working. -- John Baldwin