Page MenuHomeFreeBSD

arm64: Teach bus_dma on arm64 about NUMA
ClosedPublic

Authored by andrew on Oct 13 2023, 10:38 AM.
Tags
None
Referenced Files
F173832394: D42187.id128710.diff
Mon, Sep 28, 6:44 PM
Unknown Object (File)
Sun, Sep 20, 8:45 PM
Unknown Object (File)
Thu, Sep 17, 1:04 AM
Unknown Object (File)
Sat, Sep 12, 10:25 AM
Unknown Object (File)
Tue, Sep 8, 4:24 AM
Unknown Object (File)
Mon, Sep 7, 2:24 AM
Unknown Object (File)
Sun, Sep 6, 9:38 AM
Unknown Object (File)
Aug 27 2026, 5:08 PM
Subscribers

Details

Summary

When allocating memory we should try to allocate from the NUMA node
closest to the device to reduce cross domain memory traffic. Teach the
arm64 bus_dma code to do this.

While here use mallocarray to guard against an unlikely integer
overflow.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 53966
Build 50856: arc lint + arc unit

Event Timeline

Nothing is setting the domain for tags belonging to the root bus devices. On amd64 this happens in acpi_pcib_acpi_attach() but I believe that implementation isn't used on arm64.

sys/arm64/arm64/busdma_bounce.c
411–413
522–524
589

Why did this change?

See D42186 for the pci change

sys/arm64/arm64/busdma_bounce.c
589

Because I switched to malloc_domainset_aligned so we could explicitly set the alignment.

I can sync the above comment with x86 as needed.

Remove unneeded casts and update the comment in bounce_bus_dmamem_alloc

This revision is now accepted and ready to land.Oct 13 2023, 3:36 PM
This revision was automatically updated to reflect the committed changes.