Is it possible to change the page size of virtual memory?

Can I change the page size of virtual memory? I ask about this because the XU section of the MMU article on wikipedia talks about different page sizes. If the page size can really be resized, how does it resize?

+5
source share
5 answers

On x86_64, you can explicitly request 2 MiB pages instead of regular 4 KiB pages using hugetlbfs . On modern cores with transparent support for huge pages, small pages can automatically concatenate with huge pages in the background, given that memory fragmentation is not large and sufficient memory is still free.

+4

, . x86_64 , , .

x86_64 ( x86) . . x86_64 4 , 9 , 12 . , .

| PML4T entry |-+
                V
  +-| PDPT entry |
  V
 | PDT entry |-+
               V
     | PT entry |-> Physical address (4kB page)

, , , , , . , , , , 512 .

| PML4T entry |-+
                V
  +-| PDPT entry |
  V
 | PDT entry (PS=1) | -> Physical address (2MB page)

, , 4 (4 ), 2 (3 ) 1 (2 ). , , , , 2 4 .

+3

.

. ( x86). , , .

+2

: http://windows.microsoft.com/en-US/windows-vista/Change-the-size-of-virtual-memory

Linux:

/usr/src/linux/include/asm-generic/page.h :

/* PAGE_SHIFT */

PAGE_SHIFT 12

.

http://www.cyberciti.biz/faq/linux-check-the-size-of-pagesize/

/proc/sys/vm/swappiness, , .

-2
source

All Articles