Thread (24 messages) 24 messages, 7 authors, 2022-01-07

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

From: Christoph Hellwig <hch@lst.de>
Date: 2021-12-21 08:56:30
Also in: kexec, linux-mm, lkml

On Fri, Dec 17, 2021 at 11:38:27AM +0000, Hyeonggon Yoo wrote:
My understanding is any buffer requested from kmalloc (without
GFP_DMA/DMA32) can be used by device driver because it allocates
continuous physical memory. It doesn't mean that buffer allocated
with kmalloc is free of addressing limitation.
Yes.
the addressing limitation comes from the capability of device, not
allocation size. if you allocate memory using alloc_pages() or kmalloc(),
the device has same limitation. and vmalloc can't be used for
devices because they have no MMU.
vmalloc can be used as well, it just needs to be setup as a scatterlist
and needs a little lover for DMA challenged platforms with the
invalidate_kernel_vmap_range and flush_kernel_vmap_range helpers.
But we can map memory outside DMA zone into bounce buffer (which resides
in DMA zone) using DMA API.
Yes, although in a few specific cases the bounce buffer could also come
from somewhere else.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help