我想问的是一级页表不同样可以通过只为进程实际使用的那些虚拟内存区来请求页表吗?作者: vestige 时间: 2008-03-31 22:09
我又想了想,会不会是因为要维护一个2的20次方
的数组比较麻烦?作者: xiaozhao73 时间: 2008-04-01 01:41
二级页表并不用全分配的,除非你用全了4G 地址空间,因为它可以分配 pde(4K)+ number of pte, not all process uses 1024*pte?
one level page table you have to do full allocate or hash to allocate less space.
power pc is using hash.作者: vestige 时间: 2008-04-01 11:28
谢谢楼上的回复,是不是说如果二级页表,就先为pde分配1024个空间,然后
按需分配pte,但是如果使用一级分页,就需要直接分配2的20次方空间大小的
页表?作者: dengcainiao 时间: 2008-04-01 11:48
页目录空间是必须要分配的,页目录指向的页表如果那段线性地址没有使用可以不分配,达到节省内存的效果作者: zx_wing 时间: 2008-04-01 12:51
。。。。。。。
在Pgtable.h中有如下代码
/*
* The Linux x86 paging architecture is 'compile-time dual-mode', it
* implements both the traditional 2-level x86 page tables and the
* newer 3-level PAE-mode page tables.
*/
#ifdef CONFIG_X86_PAE
# include <asm/pgtable-3level-defs.h>
# define PMD_SIZE (1UL << PMD_SHIFT)
# define PMD_MASK (~(PMD_SIZE-1))
#else
# include <asm/pgtable-2level-defs.h>
#endif