All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>,
	Jiri Slaby <jirislaby@gmail.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Christoph Lameter <cl@linux-foundation.org>
Cc: Greg Thelen <gthelen@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] sparsemem: on no vmemmap path put mem_map on node high too
Date: Sat, 06 Mar 2010 18:15:00 -0800	[thread overview]
Message-ID: <4B930C24.3030400@kernel.org> (raw)
In-Reply-To: <4B92F91A.5040607@kernel.org>


we need to put mem_map high when virtual memmap is not used.

before this patch
free mem pfn range on first node:
[    0.000000]  19 - 1f
[    0.000000]  28 40 - 80 95
[    0.000000]  702 740 - 1000 1000
[    0.000000]  347c - 347e
[    0.000000]  34e7 3500 - 3b80 3b8b
[    0.000000]  73b8b 73bc0 - 73c00 73c00
[    0.000000]  73ddd - 73e00
[    0.000000]  73fdd - 74000
[    0.000000]  741dd - 74200
[    0.000000]  743dd - 74400
[    0.000000]  745dd - 74600
[    0.000000]  747dd - 74800
[    0.000000]  749dd - 74a00
[    0.000000]  74bdd - 74c00
[    0.000000]  74ddd - 74e00
[    0.000000]  74fdd - 75000
[    0.000000]  751dd - 75200
[    0.000000]  753dd - 75400
[    0.000000]  755dd - 75600
[    0.000000]  757dd - 75800
[    0.000000]  759dd - 75a00
[    0.000000]  79bdd 79c00 - 7d540 7d550
[    0.000000]  7f745 - 7f750
[    0.000000]  10000b 100040 - 2080000 2080000
so only 79c00 - 7d540 are major free block under 4g...

after this patch, we will get
[    0.000000]  19 - 1f
[    0.000000]  28 40 - 80 95
[    0.000000]  702 740 - 1000 1000
[    0.000000]  347c - 347e
[    0.000000]  34e7 3500 - 3600 3600
[    0.000000]  37dd - 3800
[    0.000000]  39dd - 3a00
[    0.000000]  3bdd - 3c00
[    0.000000]  3ddd - 3e00
[    0.000000]  3fdd - 4000
[    0.000000]  41dd - 4200
[    0.000000]  43dd - 4400
[    0.000000]  45dd - 4600
[    0.000000]  47dd - 4800
[    0.000000]  49dd - 4a00
[    0.000000]  4bdd - 4c00
[    0.000000]  4ddd - 4e00
[    0.000000]  4fdd - 5000
[    0.000000]  51dd - 5200
[    0.000000]  53dd - 5400
[    0.000000]  95dd 9600 - 7d540 7d550
[    0.000000]  7f745 - 7f750
[    0.000000]  17000b 170040 - 2080000 2080000
we will have 9600 - 7d540 for major free block...

sparse-vmemmap path already used __alloc_bootmem_node_high()

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

---
 mm/sparse.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Index: linux-2.6/mm/sparse.c
===================================================================
--- linux-2.6.orig/mm/sparse.c
+++ linux-2.6/mm/sparse.c
@@ -381,13 +381,15 @@ static void __init sparse_early_usemaps_
 struct page __init *sparse_mem_map_populate(unsigned long pnum, int nid)
 {
 	struct page *map;
+	unsigned long size;
 
 	map = alloc_remap(nid, sizeof(struct page) * PAGES_PER_SECTION);
 	if (map)
 		return map;
 
-	map = alloc_bootmem_pages_node(NODE_DATA(nid),
-		       PAGE_ALIGN(sizeof(struct page) * PAGES_PER_SECTION));
+	size = PAGE_ALIGN(sizeof(struct page) * PAGES_PER_SECTION);
+	map = __alloc_bootmem_node_high(NODE_DATA(nid), size,
+					 PAGE_SIZE, __pa(MAX_DMA_ADDRESS));
 	return map;
 }
 void __init sparse_mem_maps_populate_node(struct page **map_map,
@@ -411,7 +413,8 @@ void __init sparse_mem_maps_populate_nod
 	}
 
 	size = PAGE_ALIGN(size);
-	map = alloc_bootmem_pages_node(NODE_DATA(nodeid), size * map_count);
+	map = __alloc_bootmem_node_high(NODE_DATA(nodeid), size * map_count,
+					 PAGE_SIZE, __pa(MAX_DMA_ADDRESS));
 	if (map) {
 		for (pnum = pnum_begin; pnum < pnum_end; pnum++) {
 			if (!present_section_nr(pnum))

  reply	other threads:[~2010-03-07  2:16 UTC|newest]

Thread overview: 48+ 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 18:41       ` Yinghai Lu
2010-03-05 19:09       ` Greg Thelen
2010-03-05 19:09         ` Greg Thelen
2010-03-05 20:38       ` [PATCH] x86/bootmem: introduce bootmem_default_goal Yinghai Lu
2010-03-05 20:38         ` Yinghai Lu
2010-03-06  5:44         ` please don't apply : bootmem: avoid DMA32 zone by default Yinghai Lu
2010-03-06  5:44           ` Yinghai Lu
2010-03-07  0:22           ` Andrew Morton
2010-03-07  0:22             ` Andrew Morton
2010-03-07  0:42             ` Yinghai Lu
2010-03-07  0:42               ` Yinghai Lu
2010-03-07  0:53               ` Yinghai Lu
2010-03-07  0:53                 ` Yinghai Lu
2010-03-07  2:15                 ` Yinghai Lu [this message]
2010-03-07  1:03             ` Paul Mackerras
2010-03-07  1:03               ` Paul Mackerras
2010-03-07  1:48               ` Stephen Rothwell
2010-03-07  9:16               ` Russell King
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-05 23:58         ` Johannes Weiner
2010-03-06  1:50         ` Yinghai Lu
2010-03-06  1:50           ` Yinghai Lu
2010-03-06  2:24           ` Johannes Weiner
2010-03-06  2:24             ` Johannes Weiner
2010-03-06  2:31             ` Yinghai Lu
2010-03-06  2:31               ` Yinghai Lu
2010-03-05  9:04   ` Yinghai Lu
2010-03-05  9:04     ` Yinghai Lu
2010-03-05 10:26     ` Jiri Slaby
2010-03-05 10:26       ` Jiri Slaby
2010-03-05 20:27       ` Yinghai Lu
2010-03-07  1:17       ` Yinghai Lu
2010-03-11 10:54         ` Jiri Slaby
2010-03-11 20:12           ` Yinghai Lu
2010-03-11 21:40             ` Jiri Slaby
2010-03-11 21:42               ` Yinghai Lu
2010-03-05 13:08     ` Johannes Weiner
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=4B930C24.3030400@kernel.org \
    --to=yinghai@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux-foundation.org \
    --cc=gthelen@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=hpa@zytor.com \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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.