From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 10 18:07:29 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AE721065678 for ; Wed, 10 Mar 2010 18:07:29 +0000 (UTC) (envelope-from julian@elischer.org) Received: from out-0.mx.aerioconnect.net (out-0-7.mx.aerioconnect.net [216.240.47.67]) by mx1.freebsd.org (Postfix) with ESMTP id 3EFC68FC16 for ; Wed, 10 Mar 2010 18:07:29 +0000 (UTC) Received: from idiom.com (postfix@mx0.idiom.com [216.240.32.160]) by out-0.mx.aerioconnect.net (8.13.8/8.13.8) with ESMTP id o2AI7STC020594; Wed, 10 Mar 2010 10:07:28 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id F1ABC2D601E; Wed, 10 Mar 2010 10:07:27 -0800 (PST) Message-ID: <4B97DFDE.10302@elischer.org> Date: Wed, 10 Mar 2010 10:07:26 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: son goku References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 216.240.47.51 Cc: freebsd-hackers@freebsd.org Subject: Re: physio and vmapbuf X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Mar 2010 18:07:29 -0000 son goku wrote: > Hi hackers, > I have some experience with other UNIX kernels but none with FreeBSD. > FreeBSD interests me for a potential project I might be involved in , and > therefore I started researching it. > Browsing through the I/O layer code, I stumbled upon something that looked > strange, and perhaps you guys can help me with it. > Mainly, when reading the physio path, when the I/O buffer is from user-mode, > physio calls vmapbuf. The comments says that vmapbuf actually maps the > user-buffer into kernel address space. From my experience, such mapping is > needed only for very old devices that use PIO. yes, though to some of us that is relatively recent, and in fact we still need PIO mode for quite a few devices in the embedded space. (I have a soekris machine with a flash card that I need to use PIO mode to reach). We have been saying for some time (me personally for about 18 years) that we need to handle unmapped IO better. I don't believe that it has been done yet (*), but you certainly sound like the right person to take on that project :-) (*) I last looked at physio a few years ago so if someone snuck in unmapped IO in the mean-while, please excuse me. > Newer device just use DMA for > data copy, and therefore don't need the mapping, instead they just need to > pin the memory. Checking out vmapbuf only confused me further, I couldn't > find where such kernel mapping was taken place, nevertheless I did saw that > the buf->b_data was updated according to buf->b_saveaddr in some weird > offset calculation. > Adding to this confusion, there is a buf field called b_kvabase which > supposedly stores the kernel virtual address which wasn't touched at all!! > > Any help with understanding the flow and the usage of those fields/variables > will be greatly appreciated!! > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"