4

My understanding is that, in general, there is one page table per process. My question is then: what happens in case of a page fault of the running process, if the OS has to send a page frame of a non-running process back to disk. The page table of the non-running process has to be updated too, or else when it is running again, its page table will not be correct. However in all the texts I read this is not mentioned. Am I misunderstanding something?

Raphinou
  • 95
  • 6

1 Answers1

3

Each process has a page table, but the page table is for that process and not owned by that process, but owned by the kernel (this is a bit weird wording, but I hope you get what I mean). So when a non running process is paged out to disk the page table itself is still 'running', and updated. I don't think the page table itself is ever swapped out to disk, as this would cause very weird problems.

Roy T.
  • 9,429
  • 2
  • 48
  • 70
  • 1
    Roy, What I meant is that when a page frame holding a page of process A, is put to disk, and replaced by a page of the process B, it seems 2 page tables have to be updated, but I never see this mentioned anywhere. Am I understanding this correctly? – Raphinou Jun 12 '11 at 20:08
  • Ah, I misunderstood you. I believe you are correct. process's B's page table would need to mark that page as valid, and process's A's table would need to mark that page as invalid, as to trigger a page fault next time. I would not know of any other way. But now you mention it this way, I haven't seen any explicit wording of this on slides/pages of operating system course books. – Roy T. Jun 12 '11 at 20:11