Table of Contents

Introduction

Extending the Linux page table requires several structural changes to several areas of the current page table implementation. Some of these changes may not be obvious hence the reason this page was created. There is however one question you may ask: Why would you want to extend the page table?

There are several reasons you may want to extend the Linux page table structure. For example:

Currently Linux uses a static three level page table. The three-level page table is able to be read directly by the hardware of IA32-class machines; other architectures have to copy the information in the three-level page table into a machine-readable cache in an architecture-specific format. On IA64 Linux, this format is currently the short format hardware Page Table, which is a virtual linear array.

A brief explanation

With the advent of virtual memory, memory lookups for a processor required a translation between the virtual address that it has been given to the actual physical memory location that is required. To speed up the virtual to physical translation cpu designers introduced a piece of tiny memory that is located close to the CPU called the Translation Look-aside Buffer (TLB). When a memory request is presented to the CPU, the CPU first enquires with the TLB to see if the virtual to physical translation is resident in the TLB. If it is the CPU can use this translation to access the physical memory, however if it is not present then an alternate course of action is required and is called a TLB miss.

When a TLB miss occurs the general pattern of events are as follows:

A memory lookup is a CPU architecture specific action. Since we are dealing with IA64 I will describe its lookup method.

Extending the Page Table

The following discussion is based on modifications required to extend the IA64 page table. I will attempt to generalise as much as possible so that modifications of the page table on other architectures may be clearer.

To help understand the modification that are being undertaken figure 2 presents two page table structures based on IA-64 Linux.

Figure 2a: is a 3-level page table based on 8kB pages.

IA-64-page-table-01.png Figure 2a

Figure 2b: displays the PTE extension and the halving of pte entries due to the extra field in the pte struct. Once again this example is based on 8kB page sizes.

IA-64-page-table-ext02.png Figure 2b

The 128 entries in the PGD is a user space restriction for IA-64 only.

In essence what has been altered by the pte extension is that the total mappable users virtual address space has decreased. For each region this was 1TB, and now with the extensions it is approximately 512GB based on 8KB pages.

The PGD field is broken up into two sections, the first 3 high bits refer to 5 user space regions and the lower 7 bits reference the PGD offset for each region. (see figure 2c and [1] pp 158-160 for further explanation.)

white_space_filler.png

white_space_filler.png

white_space_filler.png

ia64-va.png Figure 2c

Patches

References

  1. Mossberger David and Eranian Stephane (2002), IA-64 Linux Kernel Design and Implementation, Prentice Hall Upper Saddle River, New Jersey.

  2. Intel(2000), Intel IA-64 Architecture, Software Developer's Manual rev 01, Vol 2, IA-64 System Architecture.

  3. Gorman Mel(2003), Understanding The Linux Virtual Memory Manager, http://www.skynet.ie/~mel/projects/vm/

  4. Linux Source Code(2004), http://www.kernel.org

IA64wiki: ExtendingTheLinuxPageTable (last edited 2009-12-10 03:13:40 by localhost)

Gelato@UNSW is sponsored by
the University of New South Wales National ICT Australia The Gelato Federation Hewlett-Packard Company Australian Research Council
Please contact us with any questions or comments.