912 setting the allocated bit simplies the coalescing

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: handler returns, the CPU reexecutes the write, which now proceeds normally on the newly created page. By deferring the copying of the pages in private objects until the last possible moment, copy-on-write makes the most efficient use of scarce physical memory. 10.8.2 The fork Function Revisited Now that we understand virtual memory and memory mapping, we can get a clear idea of how the fork function creates a new process with its own independent virtual address space. When the fork function is called by the current process, the kernel creates various data structures for the new process and assigns it a unique PID. To create the virtual memory for the new process, it creates exact copies of the current process’s mm struct, area structs, and page tables. It flags each page in both processes as read-only, and flags each area struct in both processes as private copy-on-write. When the fork returns in the new process, the new process now has an exact copy of the virtual memory as it existe...
View Full Document

Ask a homework question - tutors are online