From owner-freebsd-fs@FreeBSD.ORG Fri Jan 2 11:27:06 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33F1F106564A for ; Fri, 2 Jan 2009 11:27:06 +0000 (UTC) (envelope-from rwatson@FreeBSD.rg) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 099578FC18 for ; Fri, 2 Jan 2009 11:27:06 +0000 (UTC) (envelope-from rwatson@FreeBSD.rg) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 85ADA46B29; Fri, 2 Jan 2009 06:27:05 -0500 (EST) Date: Fri, 2 Jan 2009 11:27:05 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Gerry Weaver In-Reply-To: <20081223201626.caa483ad@mail01.compvia.com> Message-ID: References: <20081223201626.caa483ad@mail01.compvia.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-fs@freebsd.org Subject: Re: Headers files included by vnode.h X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2009 11:27:06 -0000 On Tue, 23 Dec 2008, Gerry Weaver wrote: > Perfect. Yes, I am building a kernel module. This is exactly what I was > looking for. I really appreciate your help. > > I am also trying to figure out a zero copy approach to kernel memory access > from user space. Would you happen to know which list I should post the > question to? Hi Gerry: It depends a bit what you want to accomplish with zero-copy. Are you just looking for a temporary mapping into kernel space for a user page, or a mapping of a kernel page into userspace? Is it only for use by privileged processes, or is this general-purpose? There are a number of concerns to think about, such as where the page comes from, whether leaked information that might also be present in the same page, if allocated from a general user of kernel pool, might be an issue, and how to tell when you're done with the page. If you just want a kernel facility to borrow a page from a user process temporarily, take a look at src/sys/net/bpf_zerocopy.c in 8.x, which borrows a set of user pages to use in-kernel for the duration of a BPF session. Robert N M Watson Computer Laboratory University of Cambridge