Re: Copy-on-Write

2008-02-12 Thread Brandon Philips
On 00:09 Fri 08 Feb 2008, RenĂª wrote: What kernel version did you get this code? It exists in 2.6.23+ IIRC. Poke around at the git-log for kernel/sched.c Cheers, Brandon On Feb 7, 2008 9:46 PM, Brandon Philips [EMAIL PROTECTED] wrote: On 22:30 Thu 07 Feb 2008, Mulyadi Santosa

Re: Copy-on-Write

2008-02-07 Thread Mulyadi Santosa
Hi On Feb 6, 2008 12:49 PM, Rick Brown [EMAIL PROTECTED] wrote: So in linux, is a child run first or the parent? Can we rely on this information? Hm, this might be the answer: http://lxr.linux.no/linux/kernel/sched.c#L1663 it says: unsigned int __read_mostly sysctl_sched_child_runs_first

Re: Copy-on-Write

2008-02-07 Thread Brandon Philips
On 22:30 Thu 07 Feb 2008, Mulyadi Santosa wrote: On Feb 6, 2008 12:49 PM, Rick Brown [EMAIL PROTECTED] wrote: So in linux, is a child run first or the parent? Can we rely on this information? Hm, this might be the answer: http://lxr.linux.no/linux/kernel/sched.c#L1663 it says:

Re: Copy-on-Write

2008-02-07 Thread RenĂª
What kernel version did you get this code? I looked at 2.6.22.1 (my kernel version) and found this piece of code: /* * wake_up_new_task - wake up a newly created task for the first time. * * This function will do some initial scheduler statistics housekeeping * that must be done for every

Re: Copy-on-Write

2008-02-06 Thread Manish Katiyar
On Feb 6, 2008 11:19 AM, Rick Brown [EMAIL PROTECTED] wrote: Hi, I had read that the operating systems that use copy-on-write mechanism for fork(), it is better if they deliberately allow the CHILD to run first. This would be better because in 99% of the cases child will call exec() and

Re: Copy-on-Write

2008-02-06 Thread Manish Katiyar
On Feb 6, 2008 6:03 PM, Rajat Jain [EMAIL PROTECTED] wrote: Hi, I had read that the operating systems that use copy-on-write mechanism for fork(), it is better if they deliberately allow the CHILD to run first. This would be better because in 99% of the cases child will call

RE: Copy-on-Write

2008-02-06 Thread Rajat Jain
Hi, I had read that the operating systems that use copy-on-write mechanism for fork(), it is better if they deliberately allow the CHILD to run first. This would be better because in 99% of the cases child will call exec() and the new address space will be allocated. Instead if the

Re: Copy-on-Write

2008-02-06 Thread Daniel Cheng
Rajat Jain wrote: [...] So as the author says, isn't running child first a good idea that needs to be implemented? This have been discussed for a few times in lkml. The actual behavior have been change back and fore for a few times. You should never depend on this implementation detail for