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

Define where a Program generation activity aimsĀ  Program generation activity aims at Automatic generation of program

Explain fixed partitioning. Partitioning are the simpler techniques that don't involve virtual memory. Partitioning has been used in numerous variations in operating systems.

Ask questiWhat is dispatcheron #Minimum 100 words accepted#

Q. Likewise some systems support many types of structures for a file's data while others simply support a stream of bytes. What are the merits in addition to demerits? Answer:

Load Sharing : Processes are not given to a particular processor. A global queue of threads is used to maintain. Each processor, when idle, picks a thread from this queue. Note th

Briefly discuss on page replacement? Page replacement approach is fixed as follows. If no frame is free, we search one that is not presently being used and free it. We can fre

What are privileged instructions? Some of the machine instructions that may cause harm to a system are designated as privileged instructions. The hardware permits the privilege

using the transformation process model and system thinking concepts explain the key operation of TGL works.

Identifying parallelism A formal way to identify parallelism in an activity is to draw a task dependence graph in a directed graph in which each vertex represents a task to