什么时候两个虚拟地址可以映射到相同的物理地址? [英] When could 2 virtual addresses map to the same physical address?
问题描述
此处是一个操作系统/计算机体系结构问题.我正在阅读有关高速缓存的信息,有关如何对高速缓存进行虚拟索引是减少地址转换时间的一种选择.我遇到了以下问题:
An operating system/computer architecture question here. I was reading about caches, about how virtually indexing the cache is an option to reduce address translation time. I came across the following:
"Virtual cache difficulties include:
Aliasing
Two different virtual addresses may have the same physical address."
我想不出什么时候会发生这种情况.自从我的操作系统以来已经有一段时间了,我正在画一个空白.
I can't think of a scenario when this can occur. It's been a while since my O/S days and I'm drawing a blank.
有人可以举个例子吗?谢谢
Could someone provide an example? Thanks
推荐答案
两个进程可能具有共享的映射.例如,在Unix中,可执行代码通常映射到执行同一程序的所有进程之间共享的区域中. (实际上,一个单个进程可能具有相同基础内存的多个映射,例如,当mmap
是同一文件两次时.)
Two processes might have a shared mapping. E.g., in Unix, executable code is typically mapped into a region shared between all processes that execute the same program. (In fact, a single process might have several mappings of the same underlying memory, e.g. when it mmap
's the same file twice.)
这篇关于什么时候两个虚拟地址可以映射到相同的物理地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!