Page MenuHomeFreeBSD

arm64: Use only required ordering for coherent dma
AbandonedPublic

Authored by gallatin on Mon, Sep 28, 5:48 PM.
Tags
None
Referenced Files
F175056537: D60099.diff
Wed, Oct 7, 11:04 PM
Unknown Object (File)
Mon, Oct 5, 9:14 AM
Unknown Object (File)
Mon, Oct 5, 3:16 AM
Unknown Object (File)
Fri, Oct 2, 8:01 PM
Unknown Object (File)
Fri, Oct 2, 4:10 AM
Unknown Object (File)
Thu, Oct 1, 5:15 AM
Unknown Object (File)
Wed, Sep 30, 12:34 AM
Unknown Object (File)
Tue, Sep 29, 8:17 PM
Subscribers

Details

Summary

Dsb(sy) carries a huge amount of overhead.. This seems like overkill for
coherent DMA. Replace it with dmb(oshld)/dmb(oshst)

This saves about 1.5% CPU on my tiny N1 setup serving 80Gb/s of Netflix traffic.

Note this depends on D60098 to apply.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I think the dmb instructions are correct even for the non-coherent case

I think the dmb instructions are correct even for the non-coherent case

Trying to determine what you mean here.. Are you saying do the dmb for everyone, return on a NULL map, and continue to do the dsb() for non-coherent / bouncy devices?

You can replace the existing dsb calls in with the appropriate dmb from the map == NULL block.

You can replace the existing dsb calls in with the appropriate dmb from the map == NULL block.

From what I've read, I'm not sure that dmb is enough for non-coherent devices. At least it seems risky. I'd strongly prefer not to do that, as I don't have a non-coherent device that I can test with.
Would you be OK with the patch as-is? That's the limit of what I can test and what I feel comfortable with

I talked with the Arm Linux IOMMU/DMA maintainer about this & we concluded replacing the dsb's with dmb's are correct. I have HW & a local patch that I can test next week.

I've created D60407 that should handle both coherent & non-coherent cases