From owner-freebsd-arch@FreeBSD.ORG Sat Jun 28 01:04:48 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 51A6037B405 for ; Sat, 28 Jun 2003 01:04:48 -0700 (PDT) Received: from mail.cyberonic.com (mail.cyberonic.com [4.17.179.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4543643F75 for ; Sat, 28 Jun 2003 01:04:47 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (node-40244c0a.sfo.onnet.us.uu.net [64.36.76.10]) by mail.cyberonic.com (8.12.8/8.12.5) with ESMTP id h5S8ThHl015499; Sat, 28 Jun 2003 04:29:44 -0400 Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.9/8.11.6) id h5S84m5J083802; Sat, 28 Jun 2003 01:04:48 -0700 (PDT) (envelope-from jmg) Date: Sat, 28 Jun 2003 01:04:48 -0700 From: John-Mark Gurney To: Terry Lambert Message-ID: <20030628080448.GI55920@funkthat.com> Mail-Followup-To: Terry Lambert , Andrew Gallatin , Scott Long , freebsd-arch@freebsd.org References: <3EF3C12F.9060303@btc.adaptec.com> <16124.39930.142492.356163@grasshopper.cs.duke.edu> <3EFC9F2D.6020908@btc.adaptec.com> <16124.43999.333761.397624@grasshopper.cs.duke.edu> <3EFCAC7A.6060305@btc.adaptec.com> <16124.45051.919899.414795@grasshopper.cs.duke.edu> <16124.46454.595892.860118@grasshopper.cs.duke.edu> <3EFD492A.60C18556@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3EFD492A.60C18556@mindspring.com> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: Scott Long cc: Andrew Gallatin cc: freebsd-arch@freebsd.org Subject: Re: API change for bus_dma X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jun 2003 08:04:48 -0000 Terry Lambert wrote this message on Sat, Jun 28, 2003 at 00:52 -0700: > Andrew Gallatin wrote: > > Scott Long writes: > > > The approach taken with busdma is that you don't assume coherency. The > > > > Unfortunately, in our application we must assume coherency in some > > situations. We have kernel memory mmap'ed into user space for > > zero-copy io of small messages. Doing a system call to force the dma > > sync would add unacceptable latency. (we're talking sub 10us latencies > > here, without syscalls). > > "contigmalloc" > > You have to do the same thing for BT848 and fram buffers that eat > host memory instead of having their own to play in. In general, > this has to be done in the device driver, very early on in the life > of the system to stand any chance of succeeding: because we do not > properly use ELF section attribute tags, it's not possible to defrag > physical memory in FreeBSD to do these allocations later. The tags > are necessary to identify code in the defragmentation code path so > that it does not attempt to relocate itself while it's running itself. > > NB: FreeBSD doesn't support kernel paging and discard of init routines > in device drivers, once the driver is operational, for the same reason: > lack of section tags indicating "paging path" in the first instance, > and lack of section tags indicating "discard after initialization" in > the second. I'm sorry, no, this will not solve the problem he is talking about. You need to reread the information that Andrew has provided before. In a previous email you got confused on the STREAMING/COHERENT flag's meaning. Using contigmalloc only gives you a linear address space, but does not guarantee that the processor will snoop the memory write cycles by the bridge or device to keep the cache of the cpu the same with the memory. For what Andrew needs, he needs the processor to have the same information as in memory. On multiprocessor systems, it can get expensive if every processor has to snoop every memory write that happens. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."