newbie
newbie

Reputation: 45

What is the behavior of MMU in case a page fault is not handled?

I was going through the do_page_fault (x86 arch) routine. Suppose a process tries to write to a shared page which is swapped out. Then as per the execution flow in do_page_fault, if the access is valid and it is a normal page (not huge page) and the execution lets say came till do_swap_page (i.e., no errors). Once do_swap_page is executed, it returns.

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

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.

Upvotes: 2

Views: 500

Answers (1)

Oleksii Shmalko
Oleksii Shmalko

Reputation: 3778

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.

Upvotes: 1

Related Questions