1

我正在经历 do_page_fault (x86 arch) 例程。假设一个进程试图写入一个被换出的共享页面。然后根据 do_page_fault 中的执行流程,如果访问是有效的并且它是一个普通页面(不是大页面)并且执行可以说是直到 do_swap_page (即没有错误)。一旦 do_swap_page 被执行,它就会返回。

1) 但是如果换入本身由于某种原因没有处理,是否会再次出现故障?

2) 一般来说,我想了解更多关于 MMU 的详细信息,例如 - 它是否检查 pte 标志或 vm 区域标志以引发地址故障?谁能指出我可以理解MMU如何检查内存访问的来源。

4

1 回答 1

1

1) But will there be a fault again in case swap-in itself was not handled due to some reason?

Yes. Fault will be generated again and again (ISR completes successfully), till page is in place. MMU doesn't track whether previous access to this page generated interrupt or not.

However, if page fault is triggered when previous fault is handled, double fault will be triggered.

2) In general, I would like to know more detail about MMU like - does it check pte flags or vm area flags to raise fault on an address? Can anyone point me to the sources where I can understand how MMU does the checks for a memory access.

Yes, it checks.

You may check OSDev for more info.

于 2014-08-15T09:01:29.990 回答