QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1895|回复: 1

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

[复制链接]
发表于 2008-11-29 00:35:26 | 显示全部楼层 |阅读模式
在讲到为什么要用多级分页时,有这么一句话
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怎么算出来的。
发表于 2008-12-27 19:05:02 | 显示全部楼层
是 2的20次方个entry.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-20 15:04 , Processed in 0.058711 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表