Can i allocate 4GB virtual addresses (more than a certain limit) using vmalloc?

Jonathan Neuschäfer j.neuschaefer at gmx.net
Mon Aug 22 18:27:38 EDT 2011


On Mon, Aug 22, 2011 at 04:43:55PM -0500, subin gangadharan wrote:
> Hi Dave,
> 
> >Also keep in mind that when you vmalloc stuff you're allocating in
> >units of pages, and there is a guard page between each allocation. So
> >if you had 512 Mb of virtual space (which is 131,072 pages), you'll be
> >able to vmalloc a maximum of 65536 objects or 1 page each. Fewer
> >objects if they're bigger than a page.
> 
> A quick question, Suppose if I alloc 1MB of memory using vmalloc,Is there a
> guard page between each page or is it after the 1MB.

If you do it one vmalloc call your 1MiB should be continuous, i.e. if
there's a guard page it will be after your megabyte.

HTH,
	Jonathan Neuschäfer



More information about the Kernelnewbies mailing list