从性能角度来看,虚拟地址空间映射如何才能被接受?

发布于 2024-09-14 04:18:38 字数 285 浏览 0 评论 0原文

这个问题针对任何使用VAS模型的操作系统,但我将指定windows nt,因为这是我最了解的系统。

众所周知,默认情况下,32 位 Windows 上的进程本身会获得 2 GB 内存。该内存可以位于系统内存、交换文件、USB 驱动器等中。

这意味着多个进程可以在地址 0x12345678 处分配内存,但是这当然不可能映射到同一物理内存。

我的问题是,如何在不完全破坏性能的情况下完成此操作?处理器是否有某种机制来映射内存地址?

每次我们不想访问内存时都要求操作系统进行映射查找,看起来很慢。

This question is aimed at any OS using a VAS model, but I'm going to specify windows nt, since that's the system I know best.

As we all know, by default, processes on 32 bit windows get 2 GB of memory all by itself. This memory can be located in system memory, a swap file, an usb drive etc.

This means that several processes can have allocated memory at address 0x12345678, however it's of course not possible that this maps to the same physical memory.

My question is, how is this done without totally crushing performance? Do processors have some kind of mechanism to map memory addresses?

Asking the OS to do a map lookup every time we wan't to access memory, just seem so, slow..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

倾城泪 2024-09-21 04:18:38

有一个硬件设备可以执行转换 - 它称为内存管理单元 (MMU)。大多数现代 CPU,甚至智能手机等设备中使用的 CPU,都包含 MMU。

There is a hardware device that does the translation - it's called the Memory Management Unit (MMU). Most modern CPUs, even those used in devices like smartphones, include an MMU.

英雄似剑 2024-09-21 04:18:38

是的,他们有,这就是虚拟内存的用途。对由硬件映射到物理内存单元的虚拟地址 0x12345678 的每次内存访问(或者由于该虚拟地址没有物理内存而导致中断)

Yes, they have and it's what virtual memory is for. Every single memory access to virtual address 0x12345678 mapped by hardware to physical memory cell (or causes an interrupt because there is no physical memory for this virtual address)

‖放下 2024-09-21 04:18:38

早期虚拟内存实现的描述

http://www.multicians.org/multics-vm。 html

A description of an early Virtual Memory implementation

http://www.multicians.org/multics-vm.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文