lkml.org 
[lkml]   [2020]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/28] dma-mapping: use vmap insted of reimplementing it
On Wed, Apr 08, 2020 at 09:17:36PM +0800, Hillf Danton wrote:
> > @@ -62,24 +42,20 @@ void *dma_common_pages_remap(struct page **pages, size_t size,
> > void *dma_common_contiguous_remap(struct page *page, size_t size,
> > pgprot_t prot, const void *caller)
> > {
> > - int i;
> > + int count = size >> PAGE_SHIFT;
> > struct page **pages;
> > - struct vm_struct *area;
> > + void *vaddr;
> > + int i;
> >
> > - pages = kmalloc(sizeof(struct page *) << get_order(size), GFP_KERNEL);
> > + pages = kmalloc_array(count, sizeof(struct page *), GFP_KERNEL);
>
> Is it making sense to vmalloc pages as long as array size is bigger than
> PAGE_SIZE?

Maybe, maybe not. But it certainly doesn't fit this series.

\
 
 \ /
  Last update: 2020-04-08 17:43    [W:0.287 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site