<div>Hi Dave,</div><div><br></div><div>>Also keep in mind that when you vmalloc stuff you're allocating in</div>>units of pages, and there is a guard page between each allocation. So<br>>if you had 512 Mb of virtual space (which is 131,072 pages), you'll be<br>
>able to vmalloc a maximum of 65536 objects or 1 page each. Fewer<br>>objects if they're bigger than a page.<div><br></div><div>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.</div>
<div><br></div><div>With Regards,</div><div>Subin K G</div><div><br><div><br></div><div><br><br><div class="gmail_quote">On Tue, May 31, 2011 at 10:19 AM, Dave Hylands <span dir="ltr"><<a href="mailto:dhylands@gmail.com">dhylands@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Sandeep,<br>
<div class="im"><br>
On Mon, May 30, 2011 at 10:54 PM, sandeep kumar<br>
<<a href="mailto:coolsandyforyou@gmail.com">coolsandyforyou@gmail.com</a>> wrote:<br>
> Hi all,<br>
> The following link gives the memory map for the arm architecture.<br>
> <a href="http://www.arm.linux.org.uk/developer/memory.txt" target="_blank">http://www.arm.linux.org.uk/developer/memory.txt</a><br>
><br>
> I have the following doubts..<br>
> 1) Any chipset(based on arm) manufacturer(qualcom,samsung..) should follow<br>
> the same memory map.<br>
> Is it hardly constrained or can be changed?<br>
> Where are this constraints are implemented in the kernel source tree?<br>
<br>
</div>You can have 2 different configurations for the same chip which<br>
present totally different memory maps. Where things are physically in<br>
memory varies from chip to chip, regardless of the fact that they<br>
happen to use the same processor.<br>
<div class="im"><br>
> 2) while i was student, i read in OS concepts that, "Virtual memory gives an<br>
> illusion to a process,<br>
> that it has always a larger continuous address space (even more than RAM)<br>
> available to it."<br>
> So i thought i could allocate howmuch ever memory i want.<br>
> But seeing the above link,i observed there is some limitation in the address<br>
> space created by the vmalloc().<br>
> So i m now thinking that vmalloc has some limit.<br>
<br>
</div>Absolutely. You can only vmalloc as much memory as there is virtual<br>
space reserved for vmalloc. And your vmalloc memory space can become<br>
fragmented, so you could have lots of space, but not have enough<br>
contiguous virtual space left to allocate a large object.<br>
<br>
Also keep in mind that when you vmalloc stuff you're allocating in<br>
units of pages, and there is a guard page between each allocation. So<br>
if you had 512 Mb of virtual space (which is 131,072 pages), you'll be<br>
able to vmalloc a maximum of 65536 objects or 1 page each. Fewer<br>
objects if they're bigger than a page.<br>
<br>
The actual allocation of vmalloc memory is determined by the macros<br>
VMALLOC_START and VMALLOC_END. VMALLOC_START is defined in<br>
arch/arm/include/asm/pgtable.h:<br>
<a href="http://lxr.linux.no/linux+v2.6.39/arch/arm/include/asm/pgtable.h#L41" target="_blank">http://lxr.linux.no/linux+v2.6.39/arch/arm/include/asm/pgtable.h#L41</a><br>
although it can be overriden by a particular architecture.<br>
<br>
VMALLOC_END is normally defined in the machine's memory.h file, and it<br>
sits somewhere between VMALLOC_START and the beginning of I/O space.<br>
<font color="#888888"><br>
--<br>
Dave Hylands<br>
Shuswap, BC, Canada<br>
<a href="http://www.davehylands.com" target="_blank">http://www.davehylands.com</a><br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>With Regards<br>Subin Gangadharan<br><br><div>Everything should be made as simple as possible,but not simpler.</div><br>
</div></div>