Re: Does the copy-on-write usually happen on application startup?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 14 Jun 2005, Jim Cromie wrote:

> IIUC, only fork sets up the new process with COW-able pages, which may 
> or may not be copied-on-write, dependent upon whether a write happens to 
> a given page.

There's an additional source for COW pages: MAP_PRIVATE mmap
of files, especially shared libraries.  When an application
maps a shared library, this is done with a writable MAP_PRIVATE
mmap.  This means that the application can write to the mmaped
region, but the writes will not be written back to the file.

Instead, the writes will go to a private copy of the page
that was dirtied.  A COW page...

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux