public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Pekka J Enberg <penberg@cs.helsinki.fi>
Cc: linux-kernel@vger.kernel.org, npiggin@suse.de, mingo@elte.hu
Subject: Re: [PATCH] powerpc: don't pass GFP_WAIT to kmalloc() from *_maybe_bootmem()
Date: Fri, 12 Jun 2009 19:34:58 +1000	[thread overview]
Message-ID: <1244799298.7172.108.camel@pasglop> (raw)
In-Reply-To: <Pine.LNX.4.64.0906121215090.30411@melkki.cs.Helsinki.FI>

On Fri, 2009-06-12 at 12:22 +0300, Pekka J Enberg wrote:
> From: Pekka Enberg <penberg@cs.helsinki.fi>
> 
> As slab is initialized much earlier now, we must not pass GFP_WAIT to kmalloc()
> from *_maybe_bootmem() functions; otherwise slab allocators will enable
> interrupts.
> 
> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
> ---
> Ben, while we're discussing the slab side of things, can we go ahead and 
> merge this one? It should fix plenty of cases for powerpc.

We can, but it's a plaster... I won't fix it all, and again, what tells
you that things calling alloc_maybe_bootmem() don't do that specifically
-because- they can be called also much later ? (In this case, it's
__init so I'm not going to object, but I still think it's unnecessary if
we fix it properly).

Cheers,
Ben.

>  arch/powerpc/lib/alloc.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/lib/alloc.c b/arch/powerpc/lib/alloc.c
> index f53e09c..56b35e3 100644
> --- a/arch/powerpc/lib/alloc.c
> +++ b/arch/powerpc/lib/alloc.c
> @@ -9,7 +9,7 @@
>  void * __init_refok alloc_maybe_bootmem(size_t size, gfp_t mask)
>  {
>  	if (mem_init_done)
> -		return kmalloc(size, mask);
> +		return kmalloc(size, mask & ~__GFP_WAIT);
>  	else
>  		return alloc_bootmem(size);
>  }
> @@ -19,7 +19,7 @@ void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask)
>  	void *p;
>  
>  	if (mem_init_done)
> -		p = kzalloc(size, mask);
> +		p = kzalloc(size, mask & ~__GFP_WAIT);
>  	else {
>  		p = alloc_bootmem(size);
>  		if (p)


      reply	other threads:[~2009-06-12  9:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-12  9:22 [PATCH] powerpc: don't pass GFP_WAIT to kmalloc() from *_maybe_bootmem() Pekka J Enberg
2009-06-12  9:34 ` Benjamin Herrenschmidt [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=1244799298.7172.108.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=npiggin@suse.de \
    --cc=penberg@cs.helsinki.fi \
    /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