public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Veaceslav Falico <vfalico@redhat.com>
Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@suse.de>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Miloslav Trmac <mitr@redhat.com>,
	James Morris <jmorris@namei.org>, Alan Cox <alan@linux.intel.com>,
	Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Renaud Lottiaux <renaud.lottiaux@kerlabs.com>,
	Louis Rilling <louis.rilling@kerlabs.com>,
	David Howells <dhowells@redhat.com>,
	Stanislaw Gruszka <sgruszka@redhat.com>
Subject: Re: [PATCH 1/4] copy_signal cleanup: use zalloc and remove initializations
Date: Wed, 2 Dec 2009 14:57:59 +0100	[thread overview]
Message-ID: <20091202135759.GA791@redhat.com> (raw)
In-Reply-To: <20091201221036.GA10052@darkmag.usersys.redhat.com>

On 12/01, Veaceslav Falico wrote:
>
> Use kmem_cache_zalloc() on signal creation and remove unneeded initialization
> lines.

I like this series very much. Not only it cleanups and lessens the code,
it opens the possibility to do more cleanups. Say, we can simplify
exit_notify() a bit, we can remove ->group_exit_task check since we know
->notify_count < 0 can be false positive.

A couple of nits though,

> Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
> ---
>
> diff --git a/kernel/fork.c b/kernel/fork.c
> index 166b8c4..160477d 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);

Personally I don't mind, but perhaps it is better to move this change
into 3/4 which changes thread_group_cputime_init().

> @@ -855,7 +844,7 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
>  	if (clone_flags & CLONE_THREAD)
>  		return 0;
>
> -	sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);
> +	sig = kmem_cache_zalloc(signal_cachep, GFP_KERNEL);
>
> [...snip...]

Imho, very nice change.

Oleg.


  reply	other threads:[~2009-12-02 14:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-01 22:10 [PATCH 1/4] copy_signal cleanup: use zalloc and remove initializations Veaceslav Falico
2009-12-02 13:57 ` Oleg Nesterov [this message]
2009-12-02 18:27   ` Veaceslav Falico
2009-12-04 14:28   ` [PATCH v2 " Veaceslav Falico
2009-12-05 16:25     ` Oleg Nesterov
2009-12-07  7:34     ` Balbir Singh
2009-12-07 20:36     ` Andrew Morton
2009-12-08 12:37       ` Veaceslav Falico
2009-12-15 10:18       ` [PATCH v3 0/4 -mmotm] copy_signal() cleanup Veaceslav Falico
2009-12-15 10:19       ` [PATCH v3 1/4 -mmotm] copy_signal() cleanup: use zalloc and remove initializations Veaceslav Falico
2009-12-15 10:19       ` [PATCH v3 2/4 -mmotm] copy_signal() cleanup: kill taskstats_tgid_init() and acct_init_pacct() Veaceslav Falico
2009-12-15 10:19       ` [PATCH v3 3/4 -mmotm] copy_signal() cleanup: clean thread_group_cputime_init() Veaceslav Falico
2009-12-15 10:20       ` [PATCH v3 4/4 -mmotm] copy_signal() cleanup: clean tty_audit_fork() Veaceslav Falico
2009-12-04 14:29   ` [PATCH v2 2/4] copy_signal cleanup: clean acct_init_pacct() and taskstats_tgid_init() Veaceslav Falico
2009-12-05 16:33     ` Oleg Nesterov
2009-12-07 19:45       ` [PATCH] kill taskstats_tgid_init() and acct_init_pacct() and cleanup copy_signal() Veaceslav Falico
2009-12-07  7:39     ` [PATCH v2 2/4] copy_signal cleanup: clean acct_init_pacct() and taskstats_tgid_init() Balbir Singh
2009-12-04 14:29   ` [PATCH v2 3/4] copy_signal cleanup: clean thread_group_cputime_init() Veaceslav Falico
2009-12-05 16:39     ` Oleg Nesterov
2009-12-04 14:30   ` [PATCH v2 4/4] copy_signal cleanup: clean tty_audit_fork() Veaceslav Falico
2009-12-05 16:58     ` Oleg Nesterov
2009-12-05 20:04       ` Miloslav Trmac
2009-12-06 14:49         ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091202135759.GA791@redhat.com \
    --to=oleg@redhat.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@linux.intel.com \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=dhowells@redhat.com \
    --cc=gregkh@suse.de \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=louis.rilling@kerlabs.com \
    --cc=mingo@elte.hu \
    --cc=mitr@redhat.com \
    --cc=peterz@infradead.org \
    --cc=renaud.lottiaux@kerlabs.com \
    --cc=sgruszka@redhat.com \
    --cc=vfalico@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox