busdma buffer management enhancements - call for review and test

Ian Lepore freebsd at damnhippie.dyndns.org
Wed Sep 5 15:28:57 UTC 2012


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




More information about the freebsd-mips mailing list