From owner-freebsd-mips@FreeBSD.ORG Wed Sep 5 15:28:57 2012 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C5B71065675; Wed, 5 Sep 2012 15:28:57 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 68DDE8FC21; Wed, 5 Sep 2012 15:28:57 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id q85FSu67079141; Wed, 5 Sep 2012 09:28:56 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q85FSXog042721; Wed, 5 Sep 2012 09:28:33 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: Adrian Chadd In-Reply-To: References: <1346777897.1140.633.camel@revolution.hippie.lan> <1346803062.59094.27.camel@revolution.hippie.lan> Content-Type: text/plain; charset="us-ascii" Date: Wed, 05 Sep 2012 09:28:33 -0600 Message-ID: <1346858913.59094.76.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-arm@freebsd.org, freebsd-mips@freebsd.org Subject: Re: busdma buffer management enhancements - call for review and test X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 15:28:57 -0000 On Tue, 2012-09-04 at 20:06 -0700, Adrian Chadd wrote: > I just want to make sure that you don't assume individual memory > access costs are the same regardless of how big the allocations are. > > Ie, if you have a bunch of scattered L1-sized allocations, versus them > all being nearby in the same 512/1024 byte page; the underlying memory > architecture may be doing memory transactions at a slightly larger > size than your L1 assumption. > > Damn these hierarchicial memory systems. I think nothing about my code significantly changes the current situation in this regard. Right now bus_dmamem_alloc() gets small chunks of memory from malloc(9), which means they come from a set of power-of-two-sized uma zones. With my changes the memory comes from a similar set of 2^N sized uma zones, but they're segregated from the zones used by malloc(9) so that memory in a single cache line never contains data for both DMA and non-DMA (or two unrelated DMA) users at once. -- Ian