首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >为什么每个进程(或任何地址空间)都有自己的页面表?

为什么每个进程(或任何地址空间)都有自己的页面表?
EN

Stack Overflow用户
提问于 2016-01-10 14:05:18
回答 1查看 992关注 0票数 0
  1. 为什么每个进程(或任何地址空间)都有自己的页表?
代码语言:javascript
运行
复制
- I think that if we use a single page table for all processes, then a process can access the address apace of other processes so we need a separate page table for each process. This means the pages which actually belong to a particular process will be valid and all other pages which belong to some other's address space will be marked invalid. Am I correct? 
- If yes, then why didn't we add one more field as "process ID" to the page table to distinguish the address space of every process?
- If not, why does every process (or any address space) have its own page table?

  1. 多级分页如何减少页表的大小?
代码语言:javascript
运行
复制
- Because we added some more page tables (in multilevel paging) as overhead, and the actual page table is also in main memory

  1. 假设我们将3级分页作为1(更接近CPU)->2->3执行;因此每个级别都有三个页面表。每个页表中包含哪些信息?我担心的第三级页表,其中包含的实际帧号,数据驻留。现在进程使用哪些页表?
代码语言:javascript
运行
复制
- All??? Then the 3rd level page table which contains the actual frames should be of the same size as the original page table (without multilevel) because it must have entries for all frames which are used by physical memory too.

EN

回答 1

Stack Overflow用户

发布于 2016-01-13 09:08:43

是的,您正确地说,单独的页表背后的原因之一是安全问题。分页接口通过硬件向操作系统公开。硬件不明白什么是进程?进程语义是OS design.For的一部分,这是我们不能将进程ID添加到页面表中的原因。您可以查看硬件手册来了解分页工作原理。是的,您是对的,多级页面无助于缩小页表的大小。在我看来,硬件需求是顶级的,页面表必须始终映射到内存中。如果只有一个级别,则始终需要映射所有页表页,即使它们未被使用。这可能是硬件公开多层页表的原因之一。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34706311

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档