0

This article says that Linux uses three-level page tables.

However, in the book Professional Linux Kernel Architecture, in chapter 3.3.1, it says that Linux uses five-level page tables.

Also, this article says ' The merging of five-level page tables (outside of the merge window) for 4.11-rc2, instead, barely raised an eyebrow.'

My question is how many page table levels does Kernel actually use? If it changed in the history, which version?

  • 1
    It depends upon the kernel version and the processor – Basile Starynkevitch Jul 18 '17 at 11:04
  • PLKA describes 4 levels. That's how it was for over a decade, as you can read in the LWN article you cite. – Gilles Jul 19 '17 at 22:48
2

The thing is, this is dependent on both kernel version, and processor architecture (because you have to have support in hardware for a given number of page tables). On 32-bit x86 without PAE, it's 3 levels. On 32-bit x86 with PAE I believe it's 4 levels. On 64-bit x86, it's usually 4 levels, but support for 5 got merged recently (however, only really high-end Intel server processors support this, and only very recent ones). On 64-bit SPARC, I think it's been 5 levels since the start, and I think 64-bit s390 and PPC also use 5 levels, but I'm not certain.

  • 1
    I believe the Intel processors supporting 5-level are not even released yet. – Yuhong Bao Aug 24 '17 at 19:26
1

I checked the linux kernel codes and got something different to Austin's answer.

arch/x86/Kconfig

  config PGTABLE_LEVELS
        int
        default 5 if X86_5LEVEL
        default 4 if X86_64
        default 3 if X86_PAE
        default 2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.