差异交换和分页 [英] Difference Swapping and Paging

查看:111
本文介绍了差异交换和分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

相对于Process Memory ManagementSwappingPaging之间有什么区别?

What are the differences between Swapping and Paging with reference to Process Memory Management ?

如果可以的话,也请引导我阅读教程.

Also guide me to the tutorials if any where I could get more information.

推荐答案

交换是指将整个进程地址空间(或以任何速率复制非共享文本数据段)复制到交换设备,或返回到交换设备,一口气(通常是磁盘).

Swapping refers to copying the entire process address space, or at any rate, the non-shareable-text data segment, out to the swap device, or back, in one go (typically disk).

而分页是指复制/复制地址空间的一页或多页.特别地,这是更细的颗粒.例如,在1 GB RAM地址空间中有大约250,000个4 KB页面.

Whereas paging refers to copying in/out one or more pages of the address space. In particular, this is at a much finer grain. For example, there are ~250,000 4 KB pages in a 1 GB RAM address space.

早期使用交换,例如DEC pdp-11时代Unix,1975-80年代.对于您可能想知道的所有内容以及更多内容,我是否可以推荐The Lions Document a.k.a. Lions在Unix 6th Ed上的注释.源代码,John Lions,ISBN 1-57398-013-7?

Swapping was used in the early days, e.g. DEC pdp-11 era Unix, 1975-80 ish. For all you could want to know and more, may I recommend The Lions Document a.k.a. Lions' Commentary on Unix 6th Ed. with Source Code, John Lions, ISBN 1-57398-013-7?

您肯定会喜欢第14章程序交换"的开头:"Unix,像所有分时系统和某些多程序系统一样,使用程序交换"(也称为转入/转出")在几个进程之间共享有限的主物理内存资源."

You will surely appreciate Chapter 14, "Program Swapping" which begins: "Unix, like all time-sharing systems, and some multiprogramming systems, uses "program swapping" (also called "roll-in/roll-out") to share the limited resource of the main physical memory among several processes."

分页(在Unix上)与BSD(伯克利系统发行版)一起在VAX-11/780上发布,大约在1980年开始.

Paging (on Unix) arrived with the BSD (Berkeley Systems Distribution) on the VAX-11/780 starting around 1980.

分页通常还与每页内存属性(无访问权限,只读,读写,无执行,可执行文件)以及各种虚拟内存管理技巧(如按需填充零页,按需复制)相关联.写页面,等等.

Paging is also usually associated with per-page memory attributes (no access, read-only, read-write, no execute, executable), and various virtual memory management tricks like demand-zero-filled pages, copy-on-write pages, and so forth.

在硬件方面,尽管早期的机器采用了简单的内存映射方案(例如,基本和绑定,或者简单的一级固定大小的页面映射表(例如,划分64 KB),但是无需任何内存管理硬件即可执行交换.数据地址空间分成8个,较大的物理地址空间(256 KB ... 4 MB)中的8KB页面.

Hardware-wise, swapping can be performed without any memory management HW whatsoever, although the early machines employed a simple memory mapping scheme (e.g. base and bound, or a simple one level fixed size page mapping table (e.g. divide the 64 KB data address space into 8, 8KB pages in a larger physical address space (256 KB ... 4 MB)).

相反,分页需要页面粒度虚拟内存页面表条目,这些条目通常对页面的物理地址,PTE位(例如有效,读取,写入等)进行编码.机器还需要自动(对应用程序透明)程序)提取和解释页表条目以将每个虚拟地址映射到其物理地址,和/或采取页错误异常以使OS能够使该页可访问和/或安排I/O以将其加载到物理上RAM.

In contrast, paging requires page-granularity virtual memory page table entries, which typically encode the physical address of the page, PTE bits such as valid, read, write, etc. The machine also needs to automatically (transparently to the application program) fetch and interpret page table entries as necessary to map each virtual address to its physical address, and/or take a page fault exception to enable the OS to make the page accessible and/or schedule an I/O to load it to physical RAM.

黑客很开心!

这篇关于差异交换和分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆