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开发者_如何学C would they lie below PAGE_OFFSET? Wouldn't user space processes be able to access them if that is the case?
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?
精彩评论