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
What are the three main activities of an operating system in regard to memory management? Keep track of which parts of memory are now being used and by whom. Decide which pr

What do you understand by “line balancing”? What happens if balance doesn’t exist?

What is monolithic and its diagram

What is a Latency Time Latency Time is the time required through a sector to reach below read/write head.

Write a note on deadlocks. The proper definition of deadlock A set of processes is deadlocked if every process in the set is waiting for an event that only a proces

Extend task 1 so that the requests are issued by the clients instead of the server. The server now do not use the "all_requests.dat" file. Instead every client thread reads from

When you turn in an assignment to be graded in this class, you are making the claim that you neither gave nor received assistance on the work you turned in (except, of course, assi

What is critical section? Every process has a segment code called the critical section, in which the process may be updating tables, changing variables, writing file and etc. W

Paging full question

A paper mill produces two grades of paper viz., X and Y. Because of raw material restrictions, it cannot produce more than 400 tons of grade X paper and 300 tons of grade Y paper i