From: Dave Hansen <haveblue@us.ibm.com>
To: Andy Whitcroft <apw@shadowen.org>
Cc: lhms-devel@lists.sourceforge.net, linux-mm@kvack.org
Subject: Re: [Lhms-devel] [2/7] 060 refactor setup_memory i386
Date: Thu, 28 Oct 2004 10:57:55 -0700 [thread overview]
Message-ID: <41813323.4090208@us.ibm.com> (raw)
In-Reply-To: <4181168B.3060209@shadowen.org>
[-- Attachment #1: Type: text/plain, Size: 142 bytes --]
There's no reason not to just move setup_bootmem_allocator() above the
first call to it, except for code churn. This saves a predeclaration.
[-- Attachment #2: 2_7_060_refactor_setup_memory_i386-cleanup.patch --]
[-- Type: text/plain, Size: 2242 bytes --]
---
sparsemem-dave/arch/i386/kernel/setup.c | 59 +++++++++++++++-----------------
1 files changed, 29 insertions(+), 30 deletions(-)
diff -puN arch/i386/kernel/setup.c~2_7_060_refactor_setup_memory_i386-cleanup arch/i386/kernel/setup.c
--- sparsemem/arch/i386/kernel/setup.c~2_7_060_refactor_setup_memory_i386-cleanup 2004-10-28 10:23:29.000000000 -0700
+++ sparsemem-dave/arch/i386/kernel/setup.c 2004-10-28 10:24:27.000000000 -0700
@@ -1014,36 +1014,6 @@ static void __init reserve_ebda_region(v
reserve_bootmem(addr, PAGE_SIZE);
}
-#ifndef CONFIG_DISCONTIGMEM
-void __init setup_bootmem_allocator(void);
-static unsigned long __init setup_memory(void)
-{
- /*
- * partially used pages are not usable - thus
- * we are rounding upwards:
- */
- min_low_pfn = PFN_UP(init_pg_tables_end);
-
- find_max_pfn();
-
- max_low_pfn = find_max_low_pfn();
-
-#ifdef CONFIG_HIGHMEM
- highstart_pfn = highend_pfn = max_pfn;
- if (max_pfn > max_low_pfn) {
- highstart_pfn = max_low_pfn;
- }
- printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
- pages_to_mb(highend_pfn - highstart_pfn));
-#endif
- printk(KERN_NOTICE "%ldMB LOWMEM available.\n",
- pages_to_mb(max_low_pfn));
-
- setup_bootmem_allocator();
- return max_low_pfn;
-}
-#endif /* !CONFIG_DISCONTIGMEM */
-
void __init setup_bootmem_allocator(void)
{
unsigned long bootmap_size;
@@ -1119,6 +1089,35 @@ void __init setup_bootmem_allocator(void
#endif
}
+#ifndef CONFIG_DISCONTIGMEM
+static unsigned long __init setup_memory(void)
+{
+ /*
+ * partially used pages are not usable - thus
+ * we are rounding upwards:
+ */
+ min_low_pfn = PFN_UP(init_pg_tables_end);
+
+ find_max_pfn();
+
+ max_low_pfn = find_max_low_pfn();
+
+#ifdef CONFIG_HIGHMEM
+ highstart_pfn = highend_pfn = max_pfn;
+ if (max_pfn > max_low_pfn) {
+ highstart_pfn = max_low_pfn;
+ }
+ printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
+ pages_to_mb(highend_pfn - highstart_pfn));
+#endif
+ printk(KERN_NOTICE "%ldMB LOWMEM available.\n",
+ pages_to_mb(max_low_pfn));
+
+ setup_bootmem_allocator();
+ return max_low_pfn;
+}
+#endif /* !CONFIG_DISCONTIGMEM */
+
/*
* Request address space for all standard RAM and ROM resources
* and also for regions reported as reserved by the e820.
_
prev parent reply other threads:[~2004-10-28 17:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-28 14:26 Andy Whitcroft
2004-10-28 15:51 ` [Lhms-devel] " Dave Hansen
2004-10-28 15:55 ` Andy Whitcroft
2004-10-28 16:48 ` Dave Hansen
2004-10-28 17:57 ` Dave Hansen [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=41813323.4090208@us.ibm.com \
--to=haveblue@us.ibm.com \
--cc=apw@shadowen.org \
--cc=lhms-devel@lists.sourceforge.net \
--cc=linux-mm@kvack.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