Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is page table entry size?

I found this example.

Consider a system with a 32-bit logical address space. If the page size in such a system is 4 KB (2^12), then a page table may consist of up to 1 million entries (2^32/2^12). Assuming that each entry consists of 4 bytes, each process may need up to 4 MB of physical address space for the page table alone.

What is the meaning of each entry consists of 4 bytes and why each process may need up to 4 MB of physical address space for the page table?

like image 696
Pankaj Mahato Avatar asked Apr 11 '14 16:04

Pankaj Mahato


People also ask

What is a page table entry?

Page table entry. Each page table entry (PTE) holds the mapping between a virtual address of a page and the address of a physical frame. There is also auxiliary information about the page such as a present bit, a dirty or modified bit, address space or process ID information, amongst others.

How do I know my page table size?

Page Table Size = number of page entries in page table X size of one page entry. Let's consider an example, Virtual Address Space = 2 GB = 2 X 2 ^ 30 Bytes. Page Size = 2 KB = 2 X 2 ^ 10 Bytes.

What is paging page size?

1. With computers, page size refers to the size of a page, which is a block of stored memory. Page size affects the amount of memory needed and space used when running programs. Most operating systems determine the page size when a program begins running.

How many entries are in the page table?

The page table needs one entry per page. Assuming a 4GB (2^32 byte) virtual and physical address space and a page size of 4kB (2^12 bytes), we see that the the 2^32 byte address space must be split into 2^20 pages. This means the page table must have 2^20 entries.


1 Answers

A page table is a table of conversions from virtual to physical addresses that the OS uses to artificially increase the total amount of main memory available in a system.

Physical memory is the actual bits located at addresses in memory (DRAM), while virtual memory is where the OS "lies" to processes by telling them where it's at, in order to do things like allow for 2^64 bits of address space, despite the fact that 2^34 bits is the most RAM normally used. (2^32 bits is 4 gigabytes, so 2^34 is 16 gb.) Most default page table sizes are 4096 kb for each process, but the number of page table entries can increase if the process needs more process space. Page table sizes can also initially be allocated smaller or larger amounts or memory, it's just that 4 kb is usually the best size for most processes.

Note that a page table is a table of page entries. Both can have different sizes, but page table sizes are most commonly 4096 kb or 4 mb and page table size is increased by adding more entries.

like image 61
Mdev Avatar answered Sep 20 '22 18:09

Mdev