From: Dave Hansen <haveblue@us.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Mike Kravetz <kravetz@us.ibm.com>, linux-kernel@vger.kernel.org
Subject: Re: Add SYSTEM_BOOTING_KMALLOC_AVAIL system_state
Date: Tue, 09 May 2006 10:20:04 -0700 [thread overview]
Message-ID: <1147195205.23893.15.camel@localhost.localdomain> (raw)
In-Reply-To: <20060508224952.0b43d0fd.akpm@osdl.org>
On Mon, 2006-05-08 at 22:49 -0700, Andrew Morton wrote:
> Mike Kravetz <kravetz@us.ibm.com> wrote:
> >
> > There are a few places that check the system_state variable to
> > determine if they should use the bootmem or kmalloc allocator.
> > However, this is not accurate as system_state transitions from
> > SYSTEM_BOOTING to SYSTEM_RUNNING well after the bootmem allocator
> > is no longer usable. Introduce the SYSTEM_BOOTING_KMALLOC_AVAIL
> > state which indicates the kmalloc allocator is available for use.
>
> Let's not do this - system_state is getting out of control.
>
> How about some private boolean in slab.c, and some special allocation
> function like
>
> void __init *alloc_memory_early(size_t size, gfp_t gfp_flags)
> {
> if (slab_is_available)
> return kmalloc(size, gfp_flags);
> return alloc_bootmem(size);
> }
One issue with that approach is that you can't use it for larger
allocations (which we have a lot of at boot-time). Would it be OK to
fall back to the raw page allocator for things where kmalloc() fails?
Oh, and do we want to make it explicitly NUMA aware?
-- Dave
next prev parent reply other threads:[~2006-05-09 17:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-09 5:35 Add SYSTEM_BOOTING_KMALLOC_AVAIL system_state Mike Kravetz
2006-05-09 5:49 ` Andrew Morton
2006-05-09 6:01 ` Christoph Lameter
2006-05-09 17:20 ` Dave Hansen [this message]
2006-05-09 17:48 ` Mike Kravetz
2006-05-09 21:07 ` [PATCH] alloc_memory_early() routines Mike Kravetz
2006-05-10 7:09 ` Pekka Enberg
2006-05-10 7:11 ` Christoph Lameter
2006-05-10 7:16 ` Pekka J Enberg
2006-05-10 8:29 ` Andi Kleen
2006-05-10 16:16 ` Mike Kravetz
2006-05-10 17:42 ` Pekka J Enberg
2006-05-10 7:19 ` Pekka Enberg
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=1147195205.23893.15.camel@localhost.localdomain \
--to=haveblue@us.ibm.com \
--cc=akpm@osdl.org \
--cc=kravetz@us.ibm.com \
--cc=linux-kernel@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.