On 1/11/10, Joel Fernandes <agnel.joel@xxxxxxxxx> wrote: > Oh I'm sorry, if you were talking about copying of the address space > information that can be avoided, that does not happen because it > would've already been copied before exec() in the child gets a chance > to execute.. the fork system call calls do_fork somewhere which calls > copy_process which does this copying so it can't be avoided in any > case. The book says copy-on-write itself has more overhead that is > avoided with exec() in the child, but I'm trying to figure how. > > -Joel Hi Joel... Manish is right. Please notice that he talked about "why do we do copy on write (COW) if soon after child is forked, it quickly does exec()". So yes, COW has overhead, but imagine if parent ran first. COW will be triggered for parent address space, then child soon runs too. Then it issues exec(). Clearly, this waste certain amout of memory which can be fairly avoided if child runs first. Let me know if I say something not so obvious here.... -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ