All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@cs.helsinki.fi>
To: David Rientjes <rientjes@google.com>
Cc: Nick Piggin <npiggin@suse.de>, linux-kernel@vger.kernel.org
Subject: Re: [patch] slqb: remove unnecessary conditional in kmem_cache_create
Date: Sun, 04 Oct 2009 14:51:13 +0300	[thread overview]
Message-ID: <4AC88C31.1040802@cs.helsinki.fi> (raw)
In-Reply-To: <alpine.DEB.1.00.0909292141550.3686@chino.kir.corp.google.com>

David Rientjes wrote:
> kmem_cache_open() panics when a SLAB_PANIC cache cannot be opened because
> it has early callers using the flag that do not go through
> kmem_cache_create().
> 
> If kmem_cache_open() fails for a SLAB_PANIC cache, it would have panicked
> the machine.  Thus, checking for this flag in kmem_cache_create() is
> unnecessary in the error patch since it is always clear.

Yes, but there are other error cases in kmem_cache_create() that "goto 
err" for which we do need to check for SLAB_PANIC.

> 
> Cc: Nick Piggin <npiggin@suse.de>
> Signed-off-by: David Rientjes <rientjes@google.com>
> ---
>  mm/slqb.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/slqb.c b/mm/slqb.c
> --- a/mm/slqb.c
> +++ b/mm/slqb.c
> @@ -3077,9 +3077,6 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
>  
>  err:
>  	up_write(&slqb_lock);
> -	if (flags & SLAB_PANIC)
> -		panic("%s: failed to create slab `%s'\n", __func__, name);
> -
>  	return NULL;
>  }
>  EXPORT_SYMBOL(kmem_cache_create);


      reply	other threads:[~2009-10-04 11:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-30  4:42 [patch] slqb: remove unnecessary conditional in kmem_cache_create David Rientjes
2009-10-04 11:51 ` Pekka Enberg [this message]

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=4AC88C31.1040802@cs.helsinki.fi \
    --to=penberg@cs.helsinki.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@suse.de \
    --cc=rientjes@google.com \
    /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.