Thread (5 messages) 5 messages, 2 authors, 2018-11-29

Re: remove the ->mapping_error method from dma_map_ops V2

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2018-11-29 18:53:56
Also in: linux-alpha, linux-arch, linux-iommu, lkml

On Thu, Nov 29, 2018 at 10:31 AM Christoph Hellwig [off-list ref] wrote:
quoted
Or, better yet, plan on removing the single-page dma mappign entirely
at a later date, and make the issue moot.
What would be the replacement?  Build a S/G list for every single page
mapping?  Not sure that would create a lot of happy campers..
It's what we ended up doing with some other cases, and it didn't
really end up hurting as much as I thought it would.

I'm thinking of the vfs functions that end up turning "buf, len" into

        struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = len };

and then passing it around as a single-entry iov instead (not even
that - they end up being an iov_iter, which is not just the iov, but
the whole "what _kind_ of iov" indirection)

Maybe a very similar model could be used for just simplifying the core
dma mapping setup: sure, people will want to do single-area dma, but
how bad would it be to just turn them into single-entry SG lists on
stack, and then the dma-maping internally would just always see that?

Most of the high-performance IO is already using SG lists anyway, no?
Disk/networking/whatever.

But just an idea. And the "map_sg()" error handling isn't actually any
better, I think. It returns zero on error, no? So it's not improving
the error handling.

The whole dma-mapping layer seems full of those kinds of "inspired
error handling choices" ;)

                  Linus

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help