From: Dave Hansen <haveblue@us.ibm.com>
To: linux-kernel@vger.kernel.org
Subject: [RFC][PATCH 03/12] memory hotplug prep: zone wait table at runtime
Date: Fri, 12 Aug 2005 07:47:21 -0700 [thread overview]
Message-ID: <20050812144721.3FC6AF04@kernel.beaverton.ibm.com> (raw)
In-Reply-To: <20050812144714.805F4B48@kernel.beaverton.ibm.com>
Add an if() to the wait-table init code to allow runtime
allocations to call kmalloc() instead of using the
bootmem allocator
Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
---
./arch/sparc64/kernel/dtlb_base.S | 0
memhotplug-dave/mm/page_alloc.c | 10 +++++++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff -puN mm/sparse.c~C2-kmalloc-zone_wait_table-at-runtime mm/sparse.c
diff -L mm/memory_hotplug.c -puN /dev/null /dev/null
diff -L drivers/base/memory.c -puN /dev/null /dev/null
diff -puN mm/page_alloc.c~C2-kmalloc-zone_wait_table-at-runtime mm/page_alloc.c
--- memhotplug/mm/page_alloc.c~C2-kmalloc-zone_wait_table-at-runtime 2005-08-12 07:43:44.000000000 -0700
+++ memhotplug-dave/mm/page_alloc.c 2005-08-12 07:43:44.000000000 -0700
@@ -1854,6 +1854,7 @@ static __devinit
void zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
{
int i;
+ unsigned long size_bytes;
/*
* The per-page waitqueue mechanism uses hashed waitqueues
@@ -1861,9 +1862,12 @@ void zone_wait_table_init(struct zone *z
*/
zone->wait_table_size = wait_table_size(zone_size_pages);
zone->wait_table_bits = wait_table_bits(zone->wait_table_size);
- zone->wait_table = (wait_queue_head_t *)
- alloc_bootmem_node(pgdat, zone->wait_table_size
- * sizeof(wait_queue_head_t));
+ size_bytes = zone->wait_table_size * sizeof(wait_queue_head_t);
+ if (system_state >= SYSTEM_RUNNING)
+ zone->wait_table = kmalloc(size_bytes, GFP_KERNEL);
+ else
+ zone->wait_table = alloc_bootmem_node(zone->zone_pgdat,
+ size_bytes);
for(i = 0; i < zone->wait_table_size; ++i)
init_waitqueue_head(zone->wait_table + i);
diff -L serq -puN /dev/null /dev/null
diff -puN ./arch/sparc64/kernel/dtlb_base.S~C2-kmalloc-zone_wait_table-at-runtime ./arch/sparc64/kernel/dtlb_base.S
_
next prev parent reply other threads:[~2005-08-12 14:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-12 14:47 [RFC][PATCH 01/12] memory hotplug prep: kill local_mapnr Dave Hansen
2005-08-12 14:47 ` [RFC][PATCH 02/12] memory hotplug prep: break out zone initialization Dave Hansen
2005-08-12 14:47 ` Dave Hansen [this message]
2005-08-12 14:47 ` [RFC][PATCH 04/12] memory hotplug prep: __section_nr helper Dave Hansen
2005-08-12 14:47 ` [RFC][PATCH 05/12] memory hotplug prep: fixup bad_range() Dave Hansen
2005-08-12 14:47 ` [RFC][PATCH 06/12] memory hotplug locking: node_size_lock Dave Hansen
2005-08-12 14:47 ` [RFC][PATCH 07/12] memory hotplug locking: zone span seqlock Dave Hansen
2005-08-12 14:47 ` [RFC][PATCH 08/12] memory hotplug: sysfs and add/remove functions Dave Hansen
2005-08-12 14:47 ` [RFC][PATCH 09/12] memory hotplug: move section_mem_map alloc to sparse.c Dave Hansen
2005-08-12 14:47 ` [RFC][PATCH 10/12] memory hotplug: call setup_per_zone_pages_min after hotplug Dave Hansen
2005-08-12 14:47 ` [RFC][PATCH 11/12] memory hotplug: i386 addition functions Dave Hansen
2005-08-12 14:47 ` [RFC][PATCH 12/12] memory hotplug: ppc64 specific hot-add functions Dave Hansen
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=20050812144721.3FC6AF04@kernel.beaverton.ibm.com \
--to=haveblue@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome