linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Thelen <gthelen@google.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	Johannes Weiner <hannes@cmpxchg.org>,
	linux-mm@kvack.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86/bootmem: introduce bootmem_default_goal
Date: Fri, 05 Mar 2010 12:38:46 -0800	[thread overview]
Message-ID: <4B916BD6.8010701@kernel.org> (raw)
In-Reply-To: <4B915074.4020704@kernel.org>

if you don't want to drop
|  bootmem: avoid DMA32 zone by default

today mainline tree actually DO NOT need that patch according to print out ...

please apply this one too.

[PATCH] x86/bootmem: introduce bootmem_default_goal

don't punish the 64bit systems with less 4G RAM.
they should use _pa(MAX_DMA_ADDRESS) at first pass instead of failback...

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/kernel/setup.c |   13 +++++++++++++
 include/linux/bootmem.h |    3 ++-
 mm/bootmem.c            |    4 ++++
 3 files changed, 19 insertions(+), 1 deletion(-)

Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup.c
+++ linux-2.6/arch/x86/kernel/setup.c
@@ -686,6 +686,18 @@ static void __init trim_bios_range(void)
 	sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
 }
 
+#ifdef MAX_DMA32_PFN
+static void __init set_bootmem_default_goal(void)
+{
+	if (max_pfn_mapped < MAX_DMA32_PFN)
+		bootmem_default_goal = __pa(MAX_DMA_ADDRESS);
+}
+#else
+static void __init set_bootmem_default_goal(void)
+{
+}
+#endif
+
 /*
  * Determine if we were loaded by an EFI loader.  If so, then we have also been
  * passed the efi memmap, systab, etc., so we should use these data structures
@@ -931,6 +943,7 @@ void __init setup_arch(char **cmdline_p)
 		max_low_pfn = max_pfn;
 	}
 #endif
+	set_bootmem_default_goal();
 
 	/*
 	 * NOTE: On x86-32, only from this point on, fixmaps are ready for use.
Index: linux-2.6/include/linux/bootmem.h
===================================================================
--- linux-2.6.orig/include/linux/bootmem.h
+++ linux-2.6/include/linux/bootmem.h
@@ -104,7 +104,8 @@ extern void *__alloc_bootmem_low_node(pg
 				      unsigned long goal);
 
 #ifdef MAX_DMA32_PFN
-#define BOOTMEM_DEFAULT_GOAL	(MAX_DMA32_PFN << PAGE_SHIFT)
+extern unsigned long bootmem_default_goal;
+#define BOOTMEM_DEFAULT_GOAL	bootmem_default_goal
 #else
 #define BOOTMEM_DEFAULT_GOAL	__pa(MAX_DMA_ADDRESS)
 #endif
Index: linux-2.6/mm/bootmem.c
===================================================================
--- linux-2.6.orig/mm/bootmem.c
+++ linux-2.6/mm/bootmem.c
@@ -25,6 +25,10 @@ unsigned long max_low_pfn;
 unsigned long min_low_pfn;
 unsigned long max_pfn;
 
+#ifdef MAX_DMA32_PFN
+unsigned long bootmem_default_goal = (MAX_DMA32_PFN << PAGE_SHIFT);
+#endif
+
 #ifdef CONFIG_CRASH_DUMP
 /*
  * If we have booted due to a crash, max_pfn will be a very low value. We need

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2010-03-05 20:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04 21:21 mmotm boot panic bootmem-avoid-dma32-zone-by-default.patch Greg Thelen
2010-03-05  3:21 ` Johannes Weiner
2010-03-05  5:00   ` Yinghai Lu
2010-03-05  5:14     ` Yinghai Lu
2010-03-05 12:51       ` Johannes Weiner
2010-03-05 16:38         ` Yinghai
2010-03-05  5:17   ` Greg Thelen
2010-03-05  5:34     ` Greg Thelen
2010-03-05 18:41     ` Yinghai Lu
2010-03-05 19:09       ` Greg Thelen
2010-03-05 20:38       ` Yinghai Lu [this message]
2010-03-06  5:44         ` please don't apply : bootmem: avoid DMA32 zone by default Yinghai Lu
2010-03-07  0:22           ` Andrew Morton
2010-03-07  0:42             ` Yinghai Lu
2010-03-07  0:53               ` Yinghai Lu
2010-03-07  1:03             ` Paul Mackerras
2010-03-07  1:48               ` Stephen Rothwell
2010-03-07  9:16               ` Russell King
2010-03-05 23:58       ` mmotm boot panic bootmem-avoid-dma32-zone-by-default.patch Johannes Weiner
2010-03-06  1:50         ` Yinghai Lu
2010-03-06  2:24           ` Johannes Weiner
2010-03-06  2:31             ` Yinghai Lu
2010-03-05  9:04   ` Yinghai Lu
2010-03-05 10:26     ` Jiri Slaby
2010-03-05 20:27       ` Yinghai Lu
2010-03-05 13:08     ` Johannes Weiner

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=4B916BD6.8010701@kernel.org \
    --to=yinghai@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=gthelen@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).