Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
* vmalloc_to_page is contiguous ?
@ 2019-03-18 10:55 Ranran
  2019-03-18 18:00 ` Rik van Riel
  0 siblings, 1 reply; 2+ messages in thread
From: Ranran @ 2019-03-18 10:55 UTC (permalink / raw)
  To: kernelnewbies

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.

Thank you,
ranran

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: vmalloc_to_page is contiguous ?
  2019-03-18 10:55 vmalloc_to_page is contiguous ? Ranran
@ 2019-03-18 18:00 ` Rik van Riel
  0 siblings, 0 replies; 2+ messages in thread
From: Rik van Riel @ 2019-03-18 18:00 UTC (permalink / raw)
  To: Ranran, kernelnewbies

[-- Attachment #1.1: Type: text/plain, Size: 800 bytes --]

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.

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-18 10:55 vmalloc_to_page is contiguous ? Ranran
2019-03-18 18:00 ` Rik van Riel

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox