<div dir="ltr">Jeff/Pramod,<div><br></div><div>I think what Pramod mentioned is partly right. However, I do not have more info on that yet. Will get back after some more digging in. For kernel memory </div><div>addresses you can do,</div>
<div><br></div><div>sudo cat /proc/vmallocinfo<br></div><div><br></div><div>This is in line with what Jeff mentioned. I will check why the upper 16 bits are set to 1.</div><div><br></div></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Thu, Mar 6, 2014 at 11:13 AM, Jeff Haran <span dir="ltr"><<a href="mailto:Jeff.Haran@citrix.com" target="_blank">Jeff.Haran@citrix.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">> -----Original Message-----<br>
> From: pramod gurav [mailto:<a href="mailto:pramod.gurav.etc@gmail.com">pramod.gurav.etc@gmail.com</a>]<br>
> Sent: Thursday, March 06, 2014 12:56 AM<br>
> To: Jeff Haran<br>
> Cc: priyaranjan; kernelnewbies<br>
> Subject: Re: Linux MM : virtual memory address space<br>
><br>
> On Wed, Mar 5, 2014 at 12:39 AM, Jeff Haran <<a href="mailto:Jeff.Haran@citrix.com">Jeff.Haran@citrix.com</a>> wrote:<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > From: <a href="mailto:kernelnewbies-bounces@kernelnewbies.org">kernelnewbies-bounces@kernelnewbies.org</a><br>
> > [mailto:<a href="mailto:kernelnewbies-bounces@kernelnewbies.org">kernelnewbies-bounces@kernelnewbies.org</a>] On Behalf Of pramod gurav<br>
> > Sent: Monday, March 03, 2014 11:33 PM<br>
> > To: priyaranjan<br>
> > Cc: kernelnewbies<br>
> > Subject: Re: Linux MM : virtual memory address space<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > On Mon, Mar 3, 2014 at 11:52 PM, priyaranjan <<a href="mailto:priyaranjan45678@gmail.com">priyaranjan45678@gmail.com</a>><br>
> > wrote:<br>
> ><br>
> > I was going through <a href="http://linux-mm.org/HighMemory" target="_blank">http://linux-mm.org/HighMemory</a><br>
> ><br>
> ><br>
> > "Currently the 32 bit x86 architecture is the most popular type of computer.<br>
> > In this architecture, traditionally the Linux kernel has split the 4GB of<br>
> > virtual memory address space into 3GB for user programs and 1GB for the<br>
> > kernel"<br>
> ><br>
> ><br>
> ><br>
> > What about 64-bit system? Where does the code lie in linux kernel for the<br>
> > check?<br>
> ><br>
> > Is there any latest and updated memory management documentation for Linux<br>
> > kernel?<br>
> ><br>
> ><br>
> ><br>
> > Regards,<br>
> ><br>
> > Priyaranjan<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > Priyaranjan,<br>
> ><br>
> ><br>
> ><br>
> > As below link suggests:<br>
> ><br>
> > <a href="http://users.nccs.gov/~fwang2/linux/lk_addressing.txt" target="_blank">http://users.nccs.gov/~fwang2/linux/lk_addressing.txt</a><br>
> ><br>
> ><br>
> ><br>
> > Also read this blog written in chinese:<br>
> ><br>
> ><br>
> ><br>
> > <a href="http://adam8157.info/blog/2012/07/linux-x86-64-vm/" target="_blank">http://adam8157.info/blog/2012/07/linux-x86-64-vm/</a><br>
> ><br>
> ><br>
> ><br>
> > on 64 bit arch the virtual address space is huge (2 to thr power of 64). So<br>
> > the overhead of translating the virtual addresses will be high. TO avoid<br>
> > this only lower 48 bits are used to form virtual addresses.<br>
> ><br>
> ><br>
> ><br>
> > I believe this statement about only the lower 48 bits being used it not<br>
> > correct. That would imply that the upper 16 bits of all virtual addresses on<br>
> > x86_64 would be the same, which is clearly not the case since the upper 16<br>
> > bits of user space vas are all 0s yet the upper 16 bits of kernel space vas<br>
> > are all 1s.<br>
> ><br>
> ><br>
> ><br>
> > Jeff Haran<br>
> ><br>
> ><br>
> Hi Jeff,<br>
> Just noticed a line in /proc/cpuinfo on my 64 bit linux Machine which is:<br>
><br>
> --> address sizes : 36 bits physical, 48 bits virtual<br>
><br>
> This should confirm the statement that, only lower 48 bits are used<br>
> for virtual address space on a 64 it arch.<br>
> And about upper 16 bits in kernel being 1s in the address range shown<br>
> in the link, I think they are not correct.<br>
<br>
</div></div>All I can suggest is that you take a kernel and modify it to prink() the virtual address of some kernel data structure (or write a module to do the same) and see for yourself. At least on the x86_64 systems I use, the address of for example a struct sk_buff, which is allocated from a kmem cache, is in the upper end of the 64 bit address range. The top 16 bits are all 1s. Always. This is running recent Redhat EL6, but I believe the same will be true for kernels from <a href="http://kernel.org" target="_blank">kernel.org</a>.<br>
<span class="HOEnZb"><font color="#888888"><br>
Jeff Haran<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<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></div>