From owner-freebsd-arch@FreeBSD.ORG Wed Apr 16 17:03:42 2008 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37342106566C; Wed, 16 Apr 2008 17:03:42 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 2149E8FC33; Wed, 16 Apr 2008 17:03:42 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 0DC251A4D8B; Wed, 16 Apr 2008 10:03:42 -0700 (PDT) Date: Wed, 16 Apr 2008 10:03:42 -0700 From: Alfred Perlstein To: Pawel Jakub Dawidek Message-ID: <20080416170341.GN95731@elvis.mu.org> References: <20071218092222.GA9695@freebsd.org> <200712201138.56423.jhb@freebsd.org> <20080412112019.GI45299@garage.freebsd.pl> <200804161014.41025.jhb@freebsd.org> <20080416165612.GA31094@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080416165612.GA31094@garage.freebsd.pl> User-Agent: Mutt/1.4.2.3i Cc: rwatson@freebsd.org, Roman Divacky , kib@freebsd.org, freebsd-arch@freebsd.org Subject: Re: final decision about *at syscalls 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: Wed, 16 Apr 2008 17:03:42 -0000 * Pawel Jakub Dawidek [080416 09:56] wrote: > On Wed, Apr 16, 2008 at 10:14:40AM -0400, John Baldwin wrote: > > On Saturday 12 April 2008 07:20:19 am Pawel Jakub Dawidek wrote: > > > From what you write John, #1 is a better choice than #2. If you want to > > > avoid races, you can pass already locked vnode. In case of file > > > descriptors, if p_fd is not locked another thread can close and open > > > different directory under the same descriptor number. > > > > Did you read Robert's paper? Do you not realize that the kernel copying data > > in from userland multiple times and having it change in between is very bug > > prone? > > Believe me I'm fully aware of the problems Robert described in his > paper. With vnode approach where do you have more data copying between > kernel and userland? > > File descriptor proposal works like this: > > userland > openat(fd, path) > kernel > NDINIT_AT(&vp, path, fd); > /* operate on vp */ > > Vnode proposal works this way: > > userland > openat(fd, path) > kernel > dvp = file_descriptor_to_vnode(fd); > NDINIT_AT(&vp, path, dvp); > /* operate on vp */ My first impression is that passing fp to vp code is a layering violation and bad news. I need to think about it more. -- - Alfred Perlstein