All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH] Use kzalloc
Date: Mon, 07 Aug 2006 11:45:55 +0000	[thread overview]
Message-ID: <44D727F3.2010804@bfs.de> (raw)
In-Reply-To: <11546380282929-git-send-email-tom_hisch@gmx.at>

hi thomas,
this patch results in:

#ifdef CONFIG_DEBUG_STACK_USAGE
#define alloc_thread_info(tsk) kzalloc(THREAD_SIZE, GFP_KERNEL)
#else
#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL)
#endif

does it make sense to have two case ? the performance penalty should not 
matter if this is reduced to
#define alloc_thread_info(tsk) kzalloc(THREAD_SIZE, GFP_KERNEL)
in any case. opinions ?

just my 2 cents,
  walter




tom_hisch@gmx.at wrote:
> From: Thomas Hisch <t.hisch@gmail.com>
> 
> Replace kzalloc instead of kmalloc + memset.
> 
> Signed-off-by: Thomas Hisch <t.hisch@gmail.com>
> ---
>  include/asm-i386/thread_info.h |   10 +---------
>  1 files changed, 1 insertions(+), 9 deletions(-)
> 
> diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
> index 54d6d7a..46d32ad 100644
> --- a/include/asm-i386/thread_info.h
> +++ b/include/asm-i386/thread_info.h
> @@ -95,15 +95,7 @@ static inline struct thread_info *curren
>  
>  /* thread information allocation */
>  #ifdef CONFIG_DEBUG_STACK_USAGE
> -#define alloc_thread_info(tsk)					\
> -	({							\
> -		struct thread_info *ret;			\
> -								\
> -		ret = kmalloc(THREAD_SIZE, GFP_KERNEL);		\
> -		if (ret)					\
> -			memset(ret, 0, THREAD_SIZE);		\
> -		ret;						\
> -	})
> +#define alloc_thread_info(tsk) kzalloc(THREAD_SIZE, GFP_KERNEL)
>  #else
>  #define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL)
>  #endif
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2006-08-07 11:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-03 20:47 [KJ] [PATCH] Use kzalloc tom_hisch
2006-08-03 21:12 ` Nishanth Aravamudan
2006-08-03 21:29 ` Bernd Petrovitsch
2006-08-07 10:50 ` tom_hisch
2006-08-07 11:45 ` walter harms [this message]
2006-08-13 11:00 ` tom hisch

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=44D727F3.2010804@bfs.de \
    --to=wharms@bfs.de \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.