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 is macro expansion

Explain thread in details

What are the advantages and disadvantages of multithreading?  Advantages : Since by multithreading multiple executions are carried out in the same process environment t

What are the deadlock p revention methodologies? a.       Necessitate that processes request all resources before starting - if cannot be granted don't run. b.      Process

Give a brief introduction about the operation of your program and show that you understand the idea behind threads and mutual exclusion variable. Why do we need to use mutual exclu

what are the overall concepts of deadlock

How does an operating system make multiprogramming possible by using single processor?

Perform alpha-beta pruning on the following tree. Put an "X" over each node that is pruned. Put the final value next to all other nodes. Indicate which action MAX should take: to B

What are kernels and what do kernels do? The kernel is a program that comprises the central core of a computer operating   system. It has entire control over everything that

Consider a large web-based database. In some sense, Google is sort of like this. There might be many users who want to read from the database, but only a few users who are allowed