I've got patches pending to replace all that code with dma_direct_alloc, which will do the right thing. They were submitted for 4.16, and I will resend them after -rc1.
- [PATCH] iommu/vt-d: add NUMA awareness to intel_alloc_co... Eric Dumazet
- Re: [PATCH] iommu/vt-d: add NUMA awareness to intel... Eric Dumazet
- [PATCH v2] iommu/vt-d: add NUMA awareness to intel_... Eric Dumazet
- Re: [PATCH] iommu/vt-d: add NUMA awareness to intel... Christoph Hellwig
- Re: [PATCH] iommu/vt-d: add NUMA awareness to i... Eric Dumazet