Re: [PATCH 0/3] de_thread() should update ->real_start_time

From: John Stultz
Date: Mon Jun 10 2013 - 15:48:49 EST


On Mon, Jun 10, 2013 at 11:33 AM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> 1/3 is the obvious bugfix, 2 and 3 are minor cleanups

Acked-by: John Stultz <john.stultz@xxxxxxxxxx> for these three patches.



> I am wondering, can't we kill task->real_start_time? What if we

Yea this sounds like a good idea. Additionally the name
real_start_time is also confusing, since it naively seems it might be
the CLOCK_REALTIME start time, which is incorrect.

> simply change copy_process
>
> - do_posix_clock_monotonic_gettime(&p->start_time);
> + get_monotonic_boottime(&p->start_time);
>
> ?
>
> Afaics, this will only affect do_acct_process() and bacct_add_tsk(),
> but do we really want to exclude the suspended time in this case?

So bacct_add_tsk seems easy to change, since its just:
do_posix_clock_monotonic_gettime(&uptime);
ts = timespec_sub(uptime, tsk->start_time);

So grabbing the monotonic boot time for uptime would provide the same
relative delta.

It looks like the same is true in do_acct_process().

> Another user of ->start_time is cgroup.c and it looks wrong... But
> the change above should not make any difference.

The cgroup usage I'm unfamiliar with. Though from the comments in the
code, it seems like using boottime would be ok for this.

thanks
-john
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/