Some busdma stats

Warner Losh imp at bsdimp.com
Wed Sep 5 14:30:47 UTC 2012


On Sep 3, 2012, at 10:19 AM, Ian Lepore wrote:

> I decided that a good way to learn more about the busdma subsystem would
> be to actually work with the code rather than just reading it. 

Tis true.

> Regardless of whether we eventually fix every driver to eliminate
> transfers that aren't aligned to cache line boundaries, or somehow
> change the busdma code to automatically bounce unaligned requests, we
> need efficient allocation of small buffers aligned and sized to cache
> lines.

The issue can't be fixed in the busdma code because partial, unaligned transfers are fine, so long as the calling code avoids the entire cache line during the transfer.  Returning cache-line aligned buffers from the allocator will do that, of course, but it is also valid for the code to only use part of the buffer for the transfer.

> I wrote some code to use uma(9) to manage pools of aligned
> buffers based on size, and set up a pool of uncachable/coherent buffers
> and a pool of "regular memory" buffers.

Very cool stats.  Need to review the code you posted though...

Warner



More information about the freebsd-arch mailing list