From 949d0cae031a38bbded90df88db4002452065784 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 10 Apr 2006 22:54:16 -0700 Subject: [PATCH] --- yaml --- r: 25515 b: refs/heads/master c: f5e902817fee1589badca1284f49eecc0ef0c200 h: refs/heads/master i: 25513: 9af4b7357ce8ebec11cad0bb7aadd8d3e494ca87 25511: 75ce824eb87167bd855fdc6d91aa6de8ab984133 v: v3 --- [refs] | 2 +- trunk/fs/exec.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 5d4456b0a945..0d10ac845d40 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 491d4bed8051c655c7664b85446e13901463eb63 +refs/heads/master: f5e902817fee1589badca1284f49eecc0ef0c200 diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index 4d38ad0b70d6..3234a0c32d54 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -678,6 +678,18 @@ static int de_thread(struct task_struct *tsk) while (leader->exit_state != EXIT_ZOMBIE) yield(); + /* + * The only record we have of the real-time age of a + * process, regardless of execs it's done, is start_time. + * All the past CPU time is accumulated in signal_struct + * from sister threads now dead. But in this non-leader + * exec, nothing survives from the original leader thread, + * whose birth marks the true age of this process now. + * When we take on its identity by switching to its PID, we + * also take its birthdate (always earlier than our own). + */ + current->start_time = leader->start_time; + spin_lock(&leader->proc_lock); spin_lock(¤t->proc_lock); proc_dentry1 = proc_pid_unhash(current);