Reference : Understaning the Linux Kernel Chap.8
Ideal computer architecture上,任意page frame都是可以被access的
但實際上的電腦架構在硬體上會有些限制住page frame被使用
Linux kernel must deal with two hardware constraints of the 80 × 86 architecture:
• The Direct Memory Access (DMA) processors for old ISA buses have a strong limitation: they are able to address only the first 16 MB of RAM.
• In modern 32-bit computers with lots of RAM, the CPU cannot directly access all physical memory because the linear address space is too small. (64-bit machine have no this problem)
所以Linux2.6就把每個memory node切成三個zone:
ZONE_DMA - Contains page frames of memory below 16 MB
ZONE_NORMAL - Contains page frames of memory at and above 16 MB and below 896 MB
ZONE_HIGHMEM - Contains page frames of memory at and above 896 MB
而ZONE_DMA就是用來當作device的DMA
ZONE_DMA跟ZONE_NORMAL都可以透過linear mapping而被kernel access
但ZONE_HIGHMEM不行
舉個例來說kernel invoke __get_free_pages(GFP_HIGHMEM,0) to allocate a page frame in high memory
allocator若是指定一high memory的page frame的話,__get_free_pages() cannot return its linear address because it doesn’t
The allocation of high-memory page frames is done only through the alloc_pages()
Therefore, part of the last 128 MB of the kernel linear address space is dedicated to mapping high-memory page frames
Memory zone
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
Booting ARM system from bootloader to linux kernel有空來讀一下 會以u-boot code當作bootloader base 開到start_kernel之前的組語部分可以參考 http://gicl.cs.drexel.edu/people/sevy/linux/ARM_Linux_boot_sequence.html… Read More
Memory zoneReference : Understaning the Linux Kernel Chap.8 Ideal computer architecture上,任意page frame都是可以被access的 但實際上的電腦架構在硬體上會有些限制住page frame被使用 Linux kernel must deal with two hardware constraints of the 80 × 86 architecture: • The D… Read More
Linux memory layout每一個user process看到的vitrual memory共有4G(32 bit machine) 其中通常切成3G:1G 0x00000000-0xbfffffff: user process(3GB) 0xc0000000-0xffffffff: kernel space (1GB) 而user process(3G)是每支user process不同的,甚至每支user thread也是不同 &… 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
0 意見:
張貼留言