Page MenuHomeFreeBSD

arm64: Elide coherent busdma maps
Needs ReviewPublic

Authored by gallatin on Mon, Sep 28, 5:44 PM.
Tags
None
Referenced Files
F173865779: D60098.id187929.diff
Mon, Sep 28, 11:54 PM
F173858251: D60098.id187906.diff
Mon, Sep 28, 10:50 PM
F173854285: D60098.id187906.diff
Mon, Sep 28, 10:17 PM
F173854157: D60098.id187929.diff
Mon, Sep 28, 10:16 PM
F173854084: D60098.diff
Mon, Sep 28, 10:15 PM
F173847201: D60098.diff
Mon, Sep 28, 9:09 PM
Subscribers

Details

Summary

Avoid allocating per-transfer maps for coherent tags that cannot
bounce. Retain maps for cache synchronization, CCA realms, and KMSAN.
These un-used maps carry with them memory and cache miss overheads.

This saves close to 1% CPU on my tiny N1 setup serving ~80Gb/s of Netflix
traffic.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

FreeBSD/sys/arm64/arm64/busdma_bounce.c
980

Can this be called with a NULL map? Hmm, I guess it can. FWIW, x86 handles this in the header file so the check gets inlined sooner in sys/kern/subr_busdma_bounce.c. That is, x86 checks it in sys/x86/include/bus_dma.h:_bus_dmamap_waitok(). Presumably could do the same here?

  • handled null maps for _bus_dmamap_waitok() and bus_dmamap_unload() in the linline wrappers as suggested by @jhb
gallatin added inline comments.
FreeBSD/sys/arm64/arm64/busdma_bounce.c
980

Great idea.. Just implemented it. Thank you!