yg_sun 发表于 2008-11-29 00:35:26

请教一个understanding the linux kernel 书中的关于分页的问题

在讲到为什么要用多级分页时,有这么一句话
The aim of this two-level scheme is to reduce the amount of ram required for per-process Page Tables. If a simple one-level Page Table was used, then is would require up to 220 entries(i.e., at 4 bytes per entry, 4M of RAM) to represent the Page Table for each process(if the process used a full 4 GB linear address space), even though a process does not use all addresses in that range.

如果只用一级的话,需要1024*1024个表项来定位每一页,从而实现1024*1024*4K=4G的虚拟地址空间。每个表项4个字节,所以整个页表占用1024*1024*4byte = 4M内存,不明白文中的220 entries怎么算出来的。

lucasman 发表于 2008-12-27 19:05:02

是 2的20次方个entry.
页: [1]
查看完整版本: 请教一个understanding the linux kernel 书中的关于分页的问题