From owner-cvs-src@FreeBSD.ORG Fri Aug 8 16:49:41 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 0C6671065683; Fri, 8 Aug 2008 16:49:41 +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 80A9A8FC14; Fri, 8 Aug 2008 16:49:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m78GnX5a030165; Fri, 8 Aug 2008 12:49:34 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Ed Schouten Date: Fri, 8 Aug 2008 12:26:31 -0400 User-Agent: KMail/1.9.7 References: <200808081343.m78DhwYE068477@repoman.freebsd.org> In-Reply-To: <200808081343.m78DhwYE068477@repoman.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200808081226.32089.jhb@freebsd.org> Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Fri, 08 Aug 2008 12:49:34 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/7981/Fri Aug 8 11:29:53 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, 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: Fri, 08 Aug 2008 16:49:41 -0000 On Friday 08 August 2008 09:43:56 am Ed Schouten wrote: > ed 2008-08-08 13:43:56 UTC > > FreeBSD src repository > > Modified files: > sys/dev/io iodev.c > Log: > SVN rev 181428 on 2008-08-08 13:43:56Z by ed > > Remove D_NEEDGIANT from io(4). > > There is no need to mark this device node to use Giant. The only > architectures that use io(4) (i386 and amd64) only change a flag in > td->td_frame, which is only accessed by curthread. > > Apart from this change, I think some fishy things may happen when using > /dev/io in multithreaded applications. I haven't tested, but looking at > the code, the flag doesn't get cleared when close() is called from > another thread, but this may not be this important. > > I'm not removing D_NEEDGIANT from mem(4), because this driver isn't > Giant safe at all (it calls GIANT_REQUIRED). 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. :) Also, I don't see why memrw() is not MPSAFE actually (on amd64 and i386 at least). Stephan (ups@) even has a comment to that effect. The MTRR stuff backing memioctl() on x86 might need locking, but I think that is all mem(4) is missing. -- John Baldwin