Linux内核:进程页表驻留在哪里?
由于仅由内核使用,因此它们只能位于 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为瑞尔想说的是它们(几乎)可以驻留在物理内存中的任何地方——没有固定的映射。
页表映射在内核虚拟地址空间中(即在 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?