Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Sep 2012 08:30:42 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Ian Lepore <freebsd@damnhippie.dyndns.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: Some busdma stats
Message-ID:  <3AFC763F-011C-46B4-B500-FE21B704259F@bsdimp.com>
In-Reply-To: <1346689154.1140.601.camel@revolution.hippie.lan>
References:  <1346689154.1140.601.camel@revolution.hippie.lan>

next in thread | previous in thread | raw e-mail | index | archive | help

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.=20

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3AFC763F-011C-46B4-B500-FE21B704259F>