Life of a page, Operating System

Suppose your process starts up, and allocates some memory with malloc(). The allocator will then give part of a memory page to your process. The OS then updates the corresponding page table entry (PTE), marking the virtual page as valid. If you then try to modify part of that page, only then will the OS actually allocate a physical page, and so the PTE will now be marked as resident. In addition, since the memory has been modi?ed, the PTE will be marked dirty.

If the OS ever needs to evict this page, then, since it is dirty, the OS has to copy that page to disk (i.e. it swaps it, or performs paging). The PTE for the page is still marked valid but is now marked non-resident.

And, if we ever touch that page again (i.e. if we try to read or write it), the OS may have to evict some other page in order to bring our page back into physical memory. One obvious implication of this is that pagefaults are slow to resolve, since disk accesses are performed.

Therefore one possible optimization is for the OS to write dirty pages to disk constantly as an idle background task. Then, when it is time to evict those pages, they will be clean, and the OS won't have to write them to disk. This makes the eviction process much faster.

Posted Date: 3/12/2013 5:53:37 AM | Location : United States







Related Discussions:- Life of a page, Assignment Help, Ask Question on Life of a page, Get Answer, Expert's Help, Life of a page Discussions

Write discussion on Life of a page
Your posts are moderated
Related Questions
how the system call is work?

Define the difference between preemptive and nonpreemptive scheduling. State why strict nonpreemptive scheduling is unlikely to be used in a computer center. Preemptive schedul

Define thread cancellation & target thread. The thread cancellation is the task of terminating a thread before it has completed. A thread that is to be cancelled is often refer

Q. Explain about diffrent Process State? Process State When process executes, it changes its state. Process state is defined as the current activity of the process. Fi

The swapper work s on the biggest scheduling priority. Initially it will look for any sleeping process, if not get then it will see for the ready-to-run process for swapping. Bu

Deadlock Avoidance It's a method to evade deadlock by careful resource scheduling. This approach to the deadlock problem foresees deadlock before it actually occurs. This a

Paging full question

p0A B C D A B C D A B C D 2 0 12 2012 1000 1354 0632 0014

what are the main advantages of multiprogramming

Define race condition. When various process access and manipulate similar data concurrently, then the outcome of the execution depends on certain order in which the access take