转自:http://blog.csdn.net/wzhwho/article/details/4996510 1. 原理说明 Linux内核中采用了一种同时适用于32位和64位系统的内存分页模型,对于32位系统来说,两级页表足够用了,而在x86_64系统中,用到了四级页表,如图2-1所示.四级页表分别为: l 页全局目录(Page Global Directory) l 页上级目录(Page Upper Directory) l 页中间目
1. 原理说明 Linux内核中采用了一种同时适用于32位和64位系统的内存分页模型,对于32位系统来说,两级页表足够用了,而在x86_64系统中,用到了四级页表,如图2-1所示.四级页表分别为: l 页全局目录(Page Global Directory) l 页上级目录(Page Upper Directory) l 页中间目录(Page Middle Directory) l 页表(Page Table) 页全局目录
1.struct page /* Each physical page in the system has a struct page associated with * it to keep track of whatever it is we are using the page for at the * moment. Note that we have no way to track which tasks are using * a page, though if it is a pa
物理页面 /* * Try to keep the most commonly accessed fields in single cache lines * here (16 bytes or greater). This ordering should be particularly * beneficial on 32-bit processors. * * The first line is data used in page cache lookup, the second line
逻辑地址由16位segment selector和offset组成 根据segment selector到GDT或LDT中去查找segment descriptor 32位base,20位limit,G为0表示limit单位为1byte,1表示单位为4k bytes. 下图表示segment selector到segment的映射过程. x86提供寄存器用于快速查找(不经过GDT或LDT).每次从GDT中取出,就存到寄存器中,相当于一个缓存的作用. GDT如下图: Most Linux User