1
$\begingroup$

I'm reading a textbook which desribe VM as:

a data structure stored in physical memory known as a page table that maps virtual pages to physical pages. The address translation hardware reads the page table each time it converts a virtual address to a physical address. The operating system is responsible for maintaining the contents of the page table and transferring pages back and forth between disk and DRAM.

enter image description here

A page table is an array of page table entries (PTEs). M. If the valid bit is set, the address field indicates the start of the corresponding physical page in DRAM where the virtual page is cached. If the valid bit is not set, then a null address indicates that the virtual page has not yet been allocated. Otherwise, the address points to the start of the virtual page on disk.

So my question is, let's the PP0(VP1) has been modified and need to be written back to disk to make the change permanent. But the the PTE1 only has address(PP0) pointed to main memory, it has lost disk address VP1, so how can the changes be made to disk in this scenario?

$\endgroup$
1
  • $\begingroup$ Note that it doesn't actually matter where it goes on disk. $\endgroup$
    – user253751
    Sep 23, 2020 at 19:43

1 Answer 1

3
$\begingroup$

There are a few options:

  1. if a page is in memory then it cannot be on disk as well, As such there is no duplication and the issue doesn't exist.

  2. there is more than just the MMU's pagetable to hold paging information. This mean that the kernel has an auxiliary data structure that says where the page is on disk and the MMU page table only tracks what is in memory. This solution allows memory mapping of files whether they are on disk or over the network.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.