Linux内核:进程页表驻留在哪里?

发布于 2024-11-16 07:25:28 字数 485 浏览 4 评论 0原文

由于仅由内核使用,因此它们只能位于 PAGE_OFFSET 以上的地址中。但我正在阅读 this 页面及其末尾(在 IRC 会议中)我读到以下几行,这让我很困惑:

 saxm> riel:  so where do page tables reside? Surely not below PAGE_OFFSET? Somewhere above PAGE_OFFSET+896mb then?

riel> they could reside anywhere

saxm> anywhere from 0->4gb (on x86 with no pae)?

riel> saxm: yeah

我的意思是,为什么它们会位于 PAGE_OFFSET 下面?如果是这种情况,用户空间进程是否无法访问它们?

Being used only by the kernel, they should only lie in the addresses above PAGE_OFFSET. But I was reading this page and at the end of it (in the IRC convo) I read the following lines which really confused me:

 saxm> riel:  so where do page tables reside? Surely not below PAGE_OFFSET? Somewhere above PAGE_OFFSET+896mb then?

riel> they could reside anywhere

saxm> anywhere from 0->4gb (on x86 with no pae)?

riel> saxm: yeah

I mean, why would they lie below PAGE_OFFSET? Wouldn't user space processes be able to access them if that is the case?

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

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

发布评论

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

评论(1

兮颜 2024-11-23 07:25:28

我认为瑞尔想说的是它们(几乎)可以驻留在物理内存中的任何地方——没有固定的映射。

页表映射在内核虚拟地址空间中(即在 PAGE_OFFSET 之上),并且对用户空间不可见(正如您指出的那样,这是有道理的,因为我们不希望用户破坏自己的页表)。

看看这个相关帖子:
Linux 是否对页面目录使用自映射?页表?

I think what riel was trying to say is that they can reside (almost) anywhere in physical memory--there's not a fixed mapping.

Page tables are mapped in the kernel virtual address space (i.e. above PAGE_OFFSET), and are invisible to user space (which, like you point out, makes sense because we wouldn't want users clobbering their own page tables).

Take a look at this related post:
Does Linux use self-map for page directory and page tables?

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