2013年8月26日 星期一

Describing Physical Memory

Reference: http://www.chudov.com/tmp/LinuxVM/html/understand/node16.html

NUMA(non-uniform memory access)架構下,memory被分成很多的bank(又稱為node),而每個bank被CPU access的cost不同
Linux用struct pg_data_t來代表bank(or node)

而PC是一UMA的架構,所以只有一個pg_data_t:contig_page_data

每個node又被切成很多個block稱為zone
Linux用struct zone_t來代表zone,而每個node是ZONE_DMA, ZONE_NORMAL, ZONE_HIGHMEM其中之一
ZONE_ DMA is memory in the lower physical memory ranges which certain ISA devices require.
ZONE_ NORMAL be directly mapped by the kernel in the upper region of the linear address space which is discussed further in Section 5.1

x86架構下
ZONE_ DMA First 16MiB of memory
ZONE_ NORMAL 16MiB - 896MiB
ZONE_ HIGHMEM 896 MiB – End

It is important to note that many kernel operations can only take place using ZONE_ NORMAL so it is the most performance critical zone.

\includegraphics[width=15cm]{graphs/layout.ps}


As the address space usable by the kernel (ZONE_ NORMAL) is limited in size, the kernel has support for the concept of High Memory.
 To access memory between the range of 1GiB and 4GiB, the kernel temporarily maps pages from high memory into ZONE_ NORMAL. This is discussed further in Chapter 10. 

Related Posts:

  • Kernel Space MemoryReference : http://www.chudov.com/tmp/LinuxVM/html/understand/node28.html Kernel的virtual memory適用linear mapping,physical address 0對應到kernel virtual memory的PAGE_OFFSET(通常是0xC000_0000) 也就是說kernel virtual address - PAGE_OFFSET就… Read More
  • Time-sharing vs multitaskingTime-sharing是一把一個CPU的時間做細分,來讓多個程式"看起來"同時執行 Multitasking就是"看起來"有很多個程式同時執行 所以time-sharing一定就是multitasking 但Multitasking一定是time-sharing嗎? 如果三個CPU都各只執行一個程式,那這樣是multitasking卻不是time-sharing了 有點像是multitasking是一種結果,而要達到這種結果有許多技術 其中… Read More
  • Dynamic vs static library 最想解出的問題就是dynamic library是load在process何處 被老大assign的工作: 他發現他跑程式,不同的process,只要是有同一個dynamic library,point到library的pointer位置都是一樣,我也覺得很好奇 Dynamic library vs static library: Static:   Usually xxx.a.   整個library compile進執… Read More
  • Describing Physical MemoryReference: http://www.chudov.com/tmp/LinuxVM/html/understand/node16.html NUMA(non-uniform memory access)架構下,memory被分成很多的bank(又稱為node),而每個bank被CPU access的cost不同 Linux用struct pg_data_t來代表bank(or node) 而PC是一UMA的架構,所以只有一個p… Read More
  • Allocating and Freeing Page TablesReference : http://www.chudov.com/tmp/LinuxVM/html/understand/node26.html 因為page table的allocation跟free有很大的cost,而且又是很常要執行的操作(process create&delete) 所以Linux kernel使用quicklists來cache住用來當page table的page quicklist包含pgd_quick… Read More

0 意見:

張貼留言