本来是想写kpt的“建立”过程,ibus拼音输入打出了“简历”,我觉得也可以符合本文的内容,就用它啦。
Q(容易引起误解):
1> kernel space的thread要页表做什么,减掉offset就是physical ram address了
2> kernel thread allocate_pages()的时候,会如何更改页表?
3> user space task 切换到内核态时候,访问内存如何读取页表
4> 512mb/1g/2g的物理内存在linux kernel最终建立的page table是什么样子的
5> 512 mb的物理内存,kernel space的进程分配到的线性地址不会高于3g+512?
6> kernel thread需要用MMU做线性地址转换么,用PA/VA就是了呀,是不是和mm/active-mm有矛盾阿?
7> 1g内存的情况下,kernel thread使用高端内存映射时修改master kernel page table,其他用户态进程也会使用同样的地址,他们引起缺页异常吗
看ulk chapter 2.5 some cut text:
1) The kernel maintains a set of page tables for its own use, rooted at a so-called master kernel Page Global Directory. After system initialization, this set of page tables is never directly used by any process or kernel thread; rather, the highest entries of the master kernel Page Global Directory are the reference model for the corresponding entries of the Page Global Directories of every regular process in the system.
2)The content of the first entries of the Page Global Directory that map linear addresses lower than 0xc0000000 (the first 768 entries with PAE disabled, or the first 3 entries with PAE enabled) depends on the specific process. Conversely, the remaining entries should be the same for all processes and equal to the corresponding entries of the master kernel Page Global Directory (see the following section).
3) ulk chapter 9.2.1 however, a small complication. Whenever a process in Kernel Mode modifies a Page Table entry for a "high" linear address (above TASK_SIZE), it should also update the corresponding entry in the sets of Page Tables of all processes in the system. In fact, once set by a process in Kernel Mode, the mapping should be effective for all other processes in Kernel Mode as well. Touching the sets of Page Tables of all processes is a costly operation; therefore, Linux adopts a deferred approach.
master kernel page table是区别与every user space process's page table,基本分两块,一个是kernel threads使用的全局global page table,一个是每个进程的页表的内核部分。
(未完待续)
阅读(1785) | 评论(0) | 转发(0) |