vmalloc_to_page is contiguous ?

Rik van Riel riel at surriel.com
Mon Mar 18 14:00:51 EDT 2019


On Mon, 2019-03-18 at 12:55 +0200, Ranran wrote:
> Hello,
> 
> Does vmalloc_to_page() returns contiguous physical memory ?
> I ask becuase I see that its return value is used for DMA and DMA
> uses
> contiguous memory.
> see here:
> 
https://elixir.bootlin.com/linux/latest/source/drivers/mtd/nand/onenand/samsung.c#L657
> Yet, in vmalloc_to_page implementation:
> https://elixir.bootlin.com/linux/v4.5/source/mm/vmalloc.c#L234
> it does not seem that it creates a contiguous allocation.

That is correct, vmalloc_to_page does not create anything.

All it does is find (and return) the page address of
a single vmalloc address.

If you have a vmalloc buffer larger than PAGE_SIZE, you
will have to call vmalloc_to_page to find each individual
page.

-- 
All Rights Reversed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20190318/9f68a60b/attachment.sig>


More information about the Kernelnewbies mailing list