On Tue, Jun 22, 2021 at 05:48:10PM +0200, Christian König wrote:
Am 22.06.21 um 17:40 schrieb Jason Gunthorpe:Which dramatically reduces the cost of establishing DMA mappings, a
On Tue, Jun 22, 2021 at 05:29:01PM +0200, Christian König wrote:No it isn't. It makes devices depend on allocating struct pages for their
[SNIP]None of that is PCI P2P.
No absolutely not. NVidia GPUs work exactly the same way.
And you have tons of similar cases in embedded and SoC systems where
intermediate memory between devices isn't directly addressable with the CPU.
It is all some specialty direct transfer.
You can't reasonably call dma_map_resource() on non CPU mapped memory
for instance, what address would you pass?
Do not confuse "I am doing transfers between two HW blocks" with PCI
Peer to Peer DMA transfers - the latter is a very narrow subcase.
No, just using the dma_map_resource() interface.Ik, but yes that does "work". Logan's series is better.
BARs which is not necessary nor desired.
loop of dma_map_resource() is very expensive.
How do you prevent direct I/O on those pages for example?GUP fails.
Allocating a struct pages has their use case, for example for exposing VRAMSure, but that is an ideal we are far from obtaining, and nobody wants
as memory for HMM. But that is something very specific and should not limit
PCIe P2P DMA in general.
to work on it prefering to do hacky hacky like this.
If you believe in this then remove the scatter list from dmabuf, add a
new set of dma_map* APIs to work on physical addresses and all the
other stuff needed.
Otherwise, we have what we have and drivers don't get to opt out. This
is why the stuff in AMDGPU was NAK'd.
Jason