Re: copy-on-write overhead

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

 



>> How does running exec() in child more efficient than having
>> copy-on-write trigger in the parent?
>
> In order to create a new process (fork), you will copy the whole of
> relevant info of address space from the parent. Now if the address
> space is shared and parent runs first for any change it makes, it will
> need to copy and then modify because it doesn't know if child needs it
> or not. Since mostly after fork, if you do an exec it is guaranteed
> that child will not need this address space and the whole of copy can
> be avoided by making child to run first. (In simple terms you can take
> decision early whether this address space is useful or not for child).

But you see, running exec() also requires a copy as the program code
will have to be copied into the pages that make up the new address
space of the child.
How this copy any faster than the copy done with copy-on-write?

Thanks,
-Joel

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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