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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 5 Dec 2009 17:39:41 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Veaceslav Falico <vfalico@...hat.com>
Cc:	linux-kernel@...r.kernel.org, Greg Kroah-Hartman <gregkh@...e.de>,
	Al Viro <viro@...iv.linux.org.uk>,
	Miloslav Trmac <mitr@...hat.com>,
	James Morris <jmorris@...ei.org>,
	Alan Cox <alan@...ux.intel.com>, Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <peterz@...radead.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Balbir Singh <balbir@...ux.vnet.ibm.com>,
	Alexey Dobriyan <adobriyan@...il.com>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	Renaud Lottiaux <renaud.lottiaux@...labs.com>,
	Louis Rilling <louis.rilling@...labs.com>,
	David Howells <dhowells@...hat.com>,
	Stanislaw Gruszka <sgruszka@...hat.com>
Subject: Re: [PATCH v2 3/4] copy_signal cleanup: clean
	thread_group_cputime_init()

On 12/04, Veaceslav Falico wrote:
>
> Remove unneeded initializations in thread_group_cputime_init() and
> in posix_cpu_timers_init_group(). They are useless after
> kmem_cache_zalloc() was used in copy_signal().
>
> Signed-off-by: Veaceslav Falico <vfalico@...hat.com>
> ---
>
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index 75e6e60..4778ef7 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -825,17 +825,6 @@ static void posix_cpu_timers_init_group(struct
> signal_struct *sig)
>     /* Thread group counters. */
>     thread_group_cputime_init(sig);
>
> -   /* Expiration times and increments. */
> -   sig->it[CPUCLOCK_PROF].expires = cputime_zero;
> -   sig->it[CPUCLOCK_PROF].incr = cputime_zero;
> -   sig->it[CPUCLOCK_VIRT].expires = cputime_zero;
> -   sig->it[CPUCLOCK_VIRT].incr = cputime_zero;
> -
> -   /* Cached expiration times. */
> -   sig->cputime_expires.prof_exp = cputime_zero;
> -   sig->cputime_expires.virt_exp = cputime_zero;
> -   sig->cputime_expires.sched_exp = 0;
> -
>     if (sig->rlim[RLIMIT_CPU].rlim_cur != RLIM_INFINITY) {
>         sig->cputime_expires.prof_exp =
>             secs_to_cputime(sig->rlim[RLIMIT_CPU].rlim_cur);
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -2419,9 +2419,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
>
>  static inline void thread_group_cputime_init(struct signal_struct *sig)
>  {
> -	sig->cputimer.cputime = INIT_CPUTIME;
>  	spin_lock_init(&sig->cputimer.lock);
> -	sig->cputimer.running = 0;
>  }

Perhaps it makes sense to move thread_group_cputimer() into kernel/fork.c,
or even fold it into its single caller, posix_cpu_timers_init_group().

Acked-by: Oleg Nesterov <oleg@...hat.com>

--
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