All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Pekka J Enberg <penberg@cs.helsinki.fi>
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
	Christoph Lameter <cl@linux-foundation.org>,
	rusty@rustcorp.com.au, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: Broken "cpualloc: the allocator" patch
Date: Thu, 6 Nov 2008 03:30:59 +0100	[thread overview]
Message-ID: <20081106023059.GA3555@cmpxchg.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0811051054430.22835@melkki.cs.Helsinki.FI>

On Wed, Nov 05, 2008 at 10:57:11AM +0200, Pekka J Enberg wrote:
> Yup, makes sense. PERCPU_MODULE_RESERVE is set to zero if !CONFIG_MODULES. 
> Is there a reason we don't do something like this in bootmem allocator? 
> Hannes?
> 		Pekka
> 
> diff --git a/mm/bootmem.c b/mm/bootmem.c
> index ac5a891..ee6431f 100644
> --- a/mm/bootmem.c
> +++ b/mm/bootmem.c
> @@ -435,7 +435,9 @@ static void * __init alloc_bootmem_core(struct bootmem_data *bdata,
>  	unsigned long fallback = 0;
>  	unsigned long min, max, start, sidx, midx, step;
>  
> -	BUG_ON(!size);
> +	if (!size)
> +		return NULL;
> +
>  	BUG_ON(align & (align - 1));
>  	BUG_ON(limit && goal + size > limit);

That comes from the original code, I have no strong opinion on it.

Christoph already fixed it up by making PERCPU_MODULE_RESERVE always
!0 and it looks like all other callsites are happy with the current
behaviour.

	Hannes

  reply	other threads:[~2008-11-06  2:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-04  3:42 Broken "cpualloc: the allocator" patch Alexey Dobriyan
2008-11-04 15:38 ` Christoph Lameter
2008-11-04 15:56   ` Christoph Lameter
2008-11-05  8:42   ` Alexey Dobriyan
2008-11-05  8:57     ` Pekka J Enberg
2008-11-06  2:30       ` Johannes Weiner [this message]
2008-11-05 13:45     ` Christoph Lameter
2008-11-06 16:31       ` Alexey Dobriyan

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=20081106023059.GA3555@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=rusty@rustcorp.com.au \
    /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.