Questions tagged [page-tables]

A page table is a data structure used by the virtual memory in the operating system to store the mapping between virtual addresses and physical addresses.

A page table is a data structure used by the virtual memory in the operating system to store the mapping between virtual addresses and physical addresses. Virtual addresses are used by the accessing process, while physical addresses are used by the hardware.

Page tables are used by the memory management unit to translate the virtual addresses seen by the application into physical addresses used by the hardware to process instructions. Each entry in the page table holds a flag indicating whether the corresponding page is in real memory or not. If it is in real memory, the page table entry will contain the real memory address at which the page is stored. When a reference is made to a page by the hardware, if the page table entry for the page indicates that it is not currently in real memory, the hardware raises a page fault exception, invoking the paging supervisor component of the operating system.

Systems can have one page table for the whole system, separate page tables for each application and segment, a tree of page tables for large segments or some combination of these. If there is only one page table, different applications running at the same time use different parts of a single range of virtual addresses. If there are multiple page or segment tables, there are multiple virtual address spaces and concurrent applications with separate page tables redirect to different real addresses.

References:

Page Table - Wikipedia

Virtual Memory - Page Tables - Wikipedia

252 questions
54
votes
4 answers

How does multi-level page table save memory space?

I am trying to understand how multi-level page table saves memory. As per my understanding, Multi-level page table in total consumes more memory than single-level page table. Example : Consider a memory system with page size 64KB and 32-bit…
Anil Kumar K K
  • 1,395
  • 1
  • 16
  • 27
53
votes
2 answers

Does every process have its own page table?

Does every process have its own page table or does it simply add it's page entries into one big page table?
40
votes
2 answers

What exactly do shadow page tables (for VMMs) do?

My understanding is that shadow page tables eliminate the need to emulate physical memory inside of the VM. ie. Instead of: guest OS -> VMM + virtual physical memory -> host OS -> host hardware It's just: guest OS -> VMM -> host OS -> host…
aerain
  • 1,149
  • 3
  • 12
  • 17
26
votes
1 answer

Difference Between Page Table and Page Directory

I have been hearing the term address space often in microprocessors and microcontrollers Paradigm. I understand that an address is used to refer to a particular block of memory in the physical memory(Primary). If I'm right and address space is the…
techno
  • 6,100
  • 16
  • 86
  • 192
21
votes
3 answers

How prompt is x86 at setting the page dirty bit?

From a software point of view, what is the latency between an instruction that dirties a memory page and when the core actually marks the page dirty in the Page Table Entry (PTE)? In other words, if an instruction dirties a page, can the very next…
srking
  • 4,512
  • 1
  • 30
  • 46
21
votes
2 answers

Determine page table size for virtual memory

Consider a virtual memory system with a 38-bit virtual byte address, 1KB pages and 512 MB of physical memory. What is the total size of the page table for each process on this machine, assuming that the valid, protection, dirty and use bits take a…
John_D
  • 213
  • 1
  • 2
  • 4
20
votes
2 answers

Page table in Linux kernel space during boot

I feel confuse in page table management in Linux kernel ? In Linux kernel space, before page table is turned on. Kernel will run in virtual memory with 1-1 mapping mechanism. After page table is turned on, then kernel has consult page tables to…
Thang Le
  • 1,419
  • 1
  • 17
  • 25
14
votes
2 answers

Where is page table located?

I've been studying about paging and page tables. I don't see to understand where page tables are located. In one of the answers from stack exchange(https://unix.stackexchange.com/questions/487052/where-is-page-table-stored-in-linux), it is said…
Yunho Jin
  • 157
  • 1
  • 1
  • 6
8
votes
1 answer

x86-64 page table Global bit

Every PTE (page table entry) in this setting has a G-bit (G = Global), which controls the scope of the physical page mapped by this entry. If the G-bit is set, then the entry is global to all processes and they can all access the physical page it…
user3051390
  • 81
  • 1
  • 2
7
votes
4 answers

What is the difference between the Page Size and Page Table Entry size

I am not able to understand the difference between Page Size and Page Table Entry size. From my understanding, Page size is used to divide the Page table in equal no. of blocks called Pages and the same size is used to divide the main memory into…
7
votes
1 answer

ARM Linux Page Table Entry format -- unused bits?

I need to use two bits of the PTE to store a custom "state" value that my kernel module will use when intercepting page protection faults. I am developing on a Galaxy Nexus which has an ARM Cortex A9 (ARM v7, I believe). Linux kernel version 3.0.31.…
Kevin Boos
  • 290
  • 3
  • 13
6
votes
2 answers

Arm64 Linux Page Table Walk

Currently I'm developing some research-related programs and I need to find the pte of some specific addresses. My development environment is Juno r1 board (CPUs are A53 and A57 ) and it's running arm64 Linux kernel. I use some typical page table…
S.Wan
  • 396
  • 3
  • 18
6
votes
0 answers

How to convert virtual address to physical address from user space? Three different methods gave different results in Linux kernel 4x version

First of all, I’m sorry for so long question. I do some simulation modeling task and I need to translate user space virtual address into kernel space physical addresses. I used three different method and got three different results. Could you please…
shs_sf
  • 189
  • 2
  • 10
6
votes
1 answer

Updating page table when an entry is evicted from TLB

Is page table updated when an entry is evicted from TLB? and if so, why? what information is updated in the page table? I think updating page table is not needed when the evicted page is clean. Similarly, is page table updated when a page is cached…
aminfar
  • 2,297
  • 3
  • 27
  • 37
5
votes
3 answers

When accessing memory, will the page table accessed/dirty bit be set under a cache hit situation?

As far as I know, a memory access of CPU involves CPU cache and MMU. CPU will try to find its target in cache and if a cache miss happens, CPU will turn to MMU. During accessing by MMU, the accessed/dirty bit of correspondent page table entry will…
黄海鑫
  • 51
  • 1
  • 2
1
2 3
16 17