Re: Q on Linux Memory Management (page tables)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26-04-08 20:02, sahlot arvind wrote:

I am trying to understand linux memory management stuff. I am reading Understanding Linux Kernel - 2nd Edition. I am at chapter 2 only and I am confused like anything. It says that kernel uses 3-level paging. In case of PAE is enabled it actually uses page middle directory. My question is when IA-32 supports only 2 level paging how can _any_ kernel use 3-level of paging?

With PAE, there _are_ actually 3 levels of pagetable in hardware -- there's an added top level consisting of 4 page directory pointers (with the top 2 bits of a linear address indexing them).

If your question is (also) how Linux uses "3-level paging" when PAE is _not_ enabled then the answer is that it only does so at the source code level with the compiler optimizing out the middle level due to it being set to be 0 bits wide through defines. The 3-level system was inspired by Alpha which uses it always and this allowed less architecture specific code. This should be explained in UTLK2 somewhere though.

After all its not the job of kernel to use page tables and convert VA to
PA, rather its the job of H/W.

Yep.

Please can any body point me to some book/link, which talks about memory management (how initial page tables are setup? How final page tables are setup?) in linux in a better fashion so that after reading which I can _imagine_ various page tables in kernel, I can visualize that?

A document which is frequenly advised is Mel Gormans treatise of the 2.4 VM, available at:

http://www.csn.ul.ie/~mel/docs/vm/

I haven't read it. UTLK is useful as well, just as soon as you know which bits of it are complete crap :-/ (I have the 1st edition, not 2nd).

But to repeat some advice I gave earlier today on list as well; do yourself a favour and ignore everything about PSE-36 and PAE (and preferrably highmem as well). Those are all hacks to a 32-bit architecture to make it support more memory than is natural for it and are simply obsolete due to the advent of x86-64. All that stuff is perfectly fine when you've grown into it through x86 history but which I personally definitely would NOT want to have to learn from 0 at the moment. It's just obsolete rubbish now anyway.

Rene

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux