freebsd-src/sys/powerpc
Mitchell Horne a77e1f0f81 busdma: better handling of small segment bouncing
Typically, when a DMA transaction requires bouncing, we will break up
the request into segments that are, at maximum, page-sized.

However, in the atypical case of a driver whose maximum segment size is
smaller than PAGE_SIZE, we end up inefficiently assigning each segment
its own bounce page. For example, the dwmmc driver has a maximum segment
size of 2048 (PAGE_SIZE / 2); a 4-page transfer ends up requiring 8
bounce pages in the current scheme.

We should attempt to batch segments into bounce pages more efficiently.
This is achieved by pushing all considerations of the maximum segment
size into the new _bus_dmamap_addsegs() function, which wraps
_bus_dmamap_addseg(). Thus we allocate the minimal number of bounce
pages required to complete the entire transfer, while still performing
the transfer with smaller-sized transactions.

For most drivers with a segment size >= PAGE_SIZE, this will have no
impact. For drivers like dwmmc mentioned above, this improves the memory
and performance efficiency when bouncing a large transfer.

Co-authored-by:	jhb
Reviewed by:	jhb
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45048
2024-05-07 13:02:57 -03:00
..
aim pmap: Convert boolean_t to bool. 2024-01-31 14:48:26 -08:00
amigaone sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
booke powerpc/booke: Reserve KVA for minidump working area 2024-04-04 19:03:27 -04:00
conf sys/*/conf: do not use "../../conf/" when including std.* 2024-04-23 15:13:31 -06:00
cpufreq sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
fpu sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
include pmap: Convert boolean_t to bool. 2024-01-31 14:48:26 -08:00
mambo sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
mikrotik sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
mpc85xx new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCE 2024-03-13 15:05:54 -07:00
ofw powerpc: Bump maximum number of FDT reserved mem entries 2024-02-28 22:01:15 -05:00
powermac macio: Set resource map size 2024-04-10 22:05:38 -04:00
powernv sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
powerpc busdma: better handling of small segment bouncing 2024-05-07 13:02:57 -03:00
ps3 new-bus: Remove the 'type' argument from BUS_MAP/UNMAP_RESOURCE 2024-03-13 15:05:54 -07:00
pseries sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
psim new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCE 2024-03-13 15:05:54 -07:00