lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 17 Jun 2009 16:02:05 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Stanislaw Gruszka <sgruszka@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Roland McGrath <roland@...hat.com>,
	Vitaly Mayatskikh <vmayatsk@...hat.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] posix_cpu_timers_exit_group: do not use
	thread_group_cputimer()

On 06/17, Stanislaw Gruszka wrote:
>
> When the process exits we don't have to run new cputimer nor use running one
> (as it not accounts when tsk->exit_state != 0) to get process CPU times.
> As there is only one thread we can just use CPU times fields form task
> and signal structs.
>
> Signed-off-by: Stanislaw Gruszka <sgruszka@...hat.com>
> ---
>  kernel/posix-cpu-timers.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
> index bece7c0..e33a21c 100644
> --- a/kernel/posix-cpu-timers.c
> +++ b/kernel/posix-cpu-timers.c
> @@ -521,11 +521,12 @@ void posix_cpu_timers_exit(struct task_struct *tsk)
>  }
>  void posix_cpu_timers_exit_group(struct task_struct *tsk)
>  {
> -	struct task_cputime cputime;
> +	struct signal_struct *const sig = tsk->signal;
>
> -	thread_group_cputimer(tsk, &cputime);
>  	cleanup_timers(tsk->signal->cpu_timers,
> -		       cputime.utime, cputime.stime, cputime.sum_exec_runtime);
> +		       cputime_add(tsk->utime, sig->utime),
> +		       cputime_add(tsk->stime, sig->stime),
> +		       tsk->se.sum_exec_runtime + sig->sum_sched_runtime);
>  }

I think this is correct.

Oleg.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ