Re: pagecoloring: kernel 2.2 mm question: what is happening during fork ?

Alan Cox (alan@lxorguk.ukuu.org.uk)
Tue, 29 Jan 2002 14:37:13 +0000 (GMT)


> When I do a fork, which part of the kernel is allocating the memory for
> the childs, where and when the memory copy takes place ? I know that
> linux is doing copy on write but I don't know which part of the kernel
> is really doing the page allocation when the copy on write understands
> that the process really wants to write now. Then the second question is
> how is the memory copy done ?

The page fault handler. When you write to a copy on write page its actually
marked read-only in the hardware. The kernel copies the page marks both
copies writable and fixes up the fault so that user space doesn't see anything
happen.

Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/