内存页面的大小-使用偏移量进行推理 [英] size of page of memory - reasoning using offset

查看:876
本文介绍了内存页面的大小-使用偏移量进行推理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是理论上的考虑,但是我认为这个论坛是可以的.如果我错了,请把它移到某个地方.
虚拟地址(a8b43e)已映射到(13fcb43e).
关于页面大小我们能说些什么?

It is theoretical consideration, but I think that this forum is ok for it. If Am I wrong ask for move it somewhere.
Virtual address (a8b43e) was mapped to (13fcb43e).
What can we say about size of page ?

因此,我们应该查看偏移量的最大可能值.
在这里,我们可以看到匹配的后缀是b43e.此外,我们应该查看以下内容的二进制表示形式:8和c:
8 = 1000
c = 1100
因此,最后两个位是匹配的.页面的整个大小为< = 2 ^ {4 * 4 + 2} = 2 ^ 18.

So, we should look at maximal possible size of offset.
Here, we can see that matching suffixes is b43e. Moreover, we should look at binary representation of: 8 and c:
8 = 1000
c = 1100
So two last bits are matching. On the whole size of page is <= 2^{4*4+2} = 2^18.

可以吗?

推荐答案

您的数学是正确的,但这只为您提供了页面大小的上限,因为页面偏移量以上的某些地址位可能偶然之间匹配物理和虚拟地址.

Your math is correct, but this only gives you an upper bound on the page size, because some address bits above the page offset may happen to match by chance between the physical and virtual address.

要使用此方法查找实际页面尺寸,您需要查看大量样本并采用最小匹配长度.

To find the real page size with this method, you need to look at a lot of samples and take the minimum match length.

还要记住,由于某些原因,操作系统可能更喜欢具有更多匹配位的页面(也许

Also keep in mind the OS could be preferring pages with more matching bits for some reason (perhaps page coloring), so even a large number of samples might not ever see a match length = page offset.

这篇关于内存页面的大小-使用偏移量进行推理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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