lkml.org 
[lkml]   [2021]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone
On Wed, Dec 22, 2021 at 12:37:03PM +0000, Hyeonggon Yoo wrote:
> Oh I misunderstood this. Underlying physical address of vmalloc()-allocated memory
> can be mapped using DMA API, and it needs to be setup as scatterlist because
> the allocated memory is not physically continuous. Right?

Yes.

> BTW, looking at the API I think the scsi case can be converted to use
> dma_alloc_pages(). but driver requires 512 bytes of buffer and the API
> supports allocating by at least page size.

Overallocating is not generally a problem, but if the allocations are for
a slow path it might make more sense to stick to dma_map_* and bounce
buffer if needed.

> It's not a big problem as it allocates a single buffer but in other
> cases maybe not. Can't we use dma pool for non-coherent pages?

No.

\
 
 \ /
  Last update: 2021-12-23 09:53    [W:0.073 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site