public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: replace shrink pages with remove_active_ranges v2
@ 2008-06-14  3:05 Yinghai Lu
  2008-06-14  3:07 ` [PATCH] x86: cleanup reloated_initrd Yinghai Lu
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Yinghai Lu @ 2008-06-14  3:05 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, Andrew Morton
  Cc: linux-kernel@vger.kernel.org


in case we have kva before ramdisk on node, we still need to use
those ranges.

v2: reserve_early kva ram area, in case there are holes in highmem, to avoid
    those area could be treat as free high pages.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

Index: linux-2.6/arch/x86/mm/discontig_32.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/discontig_32.c
+++ linux-2.6/arch/x86/mm/discontig_32.c
@@ -227,8 +227,8 @@ static unsigned long calculate_numa_rema
 	unsigned long size, reserve_pages = 0;
 
 	for_each_online_node(nid) {
-		u64 node_end_target;
-		u64 node_end_final;
+		u64 node_kva_target;
+		u64 node_kva_final;
 
 		/*
 		 * The acpi/srat node info can show hot-add memroy zones
@@ -251,42 +251,45 @@ static unsigned long calculate_numa_rema
 		/* now the roundup is correct, convert to PAGE_SIZE pages */
 		size = size * PTRS_PER_PTE;
 
-		node_end_target = round_down(node_end_pfn[nid] - size,
+		node_kva_target = round_down(node_end_pfn[nid] - size,
 						 PTRS_PER_PTE);
-		node_end_target <<= PAGE_SHIFT;
+		node_kva_target <<= PAGE_SHIFT;
 		do {
-			node_end_final = find_e820_area(node_end_target,
+			node_kva_final = find_e820_area(node_kva_target,
 					((u64)node_end_pfn[nid])<<PAGE_SHIFT,
 						((u64)size)<<PAGE_SHIFT,
 						LARGE_PAGE_BYTES);
-			node_end_target -= LARGE_PAGE_BYTES;
-		} while (node_end_final == -1ULL &&
-			 (node_end_target>>PAGE_SHIFT) > (node_start_pfn[nid]));
+			node_kva_target -= LARGE_PAGE_BYTES;
+		} while (node_kva_final == -1ULL &&
+			 (node_kva_target>>PAGE_SHIFT) > (node_start_pfn[nid]));
 
-		if (node_end_final == -1ULL)
+		if (node_kva_final == -1ULL)
 			panic("Can not get kva ram\n");
 
-		printk("Reserving %ld pages of KVA for lmem_map of node %d\n",
-				size, nid);
 		node_remap_size[nid] = size;
 		node_remap_offset[nid] = reserve_pages;
 		reserve_pages += size;
-		printk("Shrinking node %d from %ld pages to %lld pages\n",
-			nid, node_end_pfn[nid], node_end_final>>PAGE_SHIFT);
+		printk("Reserving %ld pages of KVA for lmem_map of node %d at %llx\n",
+				size, nid, node_kva_final>>PAGE_SHIFT);
 
 		/*
 		 *  prevent kva address below max_low_pfn want it on system
 		 *  with less memory later.
 		 *  layout will be: KVA address , KVA RAM
+		 *
+		 *  we are supposed to only record the one less then max_low_pfn
+		 *  but we could have some hole in high memory, and it will only
+		 *  check page_is_ram(pfn) && !page_is_reserved_early(pfn) to decide
+		 *  to use it as free.
+		 *  So reserve_early here, hope we don't run out of that array
 		 */
-		if ((node_end_final>>PAGE_SHIFT) < max_low_pfn)
-			reserve_early(node_end_final,
-				      node_end_final+(((u64)size)<<PAGE_SHIFT),
-				      "KVA RAM");
-
-		node_end_pfn[nid] = node_end_final>>PAGE_SHIFT;
-		node_remap_start_pfn[nid] = node_end_pfn[nid];
-		shrink_active_range(nid, node_end_pfn[nid]);
+		reserve_early(node_kva_final,
+			      node_kva_final+(((u64)size)<<PAGE_SHIFT),
+			      "KVA RAM");
+
+		node_remap_start_pfn[nid] = node_kva_final>>PAGE_SHIFT;
+		remove_active_range(nid, node_remap_start_pfn[nid],
+					 node_remap_start_pfn[nid] + size);
 	}
 	printk("Reserving total of %ld pages for numa KVA remap\n",
 			reserve_pages);
Index: linux-2.6/include/linux/mm.h
===================================================================
--- linux-2.6.orig/include/linux/mm.h
+++ linux-2.6/include/linux/mm.h
@@ -998,7 +998,8 @@ extern void free_area_init_node(int nid,
 extern void free_area_init_nodes(unsigned long *max_zone_pfn);
 extern void add_active_range(unsigned int nid, unsigned long start_pfn,
 					unsigned long end_pfn);
-extern void shrink_active_range(unsigned int nid, unsigned long new_end_pfn);
+extern void remove_active_range(unsigned int nid, unsigned long start_pfn,
+					unsigned long end_pfn);
 extern void push_node_boundaries(unsigned int nid, unsigned long start_pfn,
 					unsigned long end_pfn);
 extern void remove_all_active_ranges(void);
Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c
+++ linux-2.6/mm/page_alloc.c
@@ -3562,30 +3562,47 @@ void __init add_active_range(unsigned in
 }
 
 /**
- * shrink_active_range - Shrink an existing registered range of PFNs
+ * remove_active_range - Shrink an existing registered range of PFNs
  * @nid: The node id the range is on that should be shrunk
- * @new_end_pfn: The new PFN of the range
+ * @start_pfn: The new PFN of the range
+ * @end_pfn: The new PFN of the range
  *
  * i386 with NUMA use alloc_remap() to store a node_mem_map on a local node.
  * The map is kept near the end physical page range that has already been
  * registered. This function allows an arch to shrink an existing registered
  * range.
  */
-void __init shrink_active_range(unsigned int nid, unsigned long new_end_pfn)
+void __init remove_active_range(unsigned int nid, unsigned long start_pfn,
+				unsigned long end_pfn)
 {
 	int i, j;
 	int removed = 0;
 
+	printk(KERN_DEBUG "remove_active_range (%d, %lu, %lu)\n",
+			  nid, start_pfn, end_pfn);
+
 	/* Find the old active region end and shrink */
 	for_each_active_range_index_in_nid(i, nid) {
-		if (early_node_map[i].start_pfn >= new_end_pfn) {
+		if (early_node_map[i].start_pfn >= start_pfn &&
+		    early_node_map[i].end_pfn <= end_pfn) {
 			/* clear it */
+			early_node_map[i].start_pfn = 0;
 			early_node_map[i].end_pfn = 0;
 			removed = 1;
 			continue;
 		}
-		if (early_node_map[i].end_pfn > new_end_pfn) {
-			early_node_map[i].end_pfn = new_end_pfn;
+		if (early_node_map[i].start_pfn < start_pfn &&
+		    early_node_map[i].end_pfn > start_pfn) {
+			unsigned long temp_end_pfn = early_node_map[i].end_pfn;
+			early_node_map[i].end_pfn = start_pfn;
+			if (temp_end_pfn > end_pfn)
+				add_active_range(nid, end_pfn, temp_end_pfn);
+			continue;
+		}
+		if (early_node_map[i].start_pfn >= start_pfn &&
+		    early_node_map[i].end_pfn > end_pfn &&
+		    early_node_map[i].start_pfn < end_pfn) {
+			early_node_map[i].start_pfn = end_pfn;
 			continue;
 		}
 	}

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH] x86: cleanup reloated_initrd
  2008-06-14  3:05 [PATCH] x86: replace shrink pages with remove_active_ranges v2 Yinghai Lu
@ 2008-06-14  3:07 ` Yinghai Lu
  2008-06-14  8:28   ` Ingo Molnar
  2008-06-14 18:41   ` H. Peter Anvin
  2008-06-14  6:23 ` [PATCH] x86: replace shrink pages with remove_active_ranges v2 Ingo Molnar
  2008-06-14  7:56 ` [PATCH] x86: use add_highpages_with_active_regions for high pages init Yinghai Lu
  2 siblings, 2 replies; 22+ messages in thread
From: Yinghai Lu @ 2008-06-14  3:07 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin, Thomas Gleixner; +Cc: linux-kernel@vger.kernel.org


1. move that before zone_sizes_init ...
2. add free_early for one old one, otherwise it will be be reserved again when
   init highmem.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

Index: linux-2.6/arch/x86/kernel/setup_32.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup_32.c
+++ linux-2.6/arch/x86/kernel/setup_32.c
@@ -585,6 +585,9 @@ static void __init relocate_initrd(void)
 	printk(KERN_INFO "Copied RAMDISK from %016llx - %016llx to %08llx - %08llx\n",
 		ramdisk_image, ramdisk_image + ramdisk_size - 1,
 		ramdisk_here, ramdisk_here + ramdisk_size - 1);
+
+	/* need to free that, otherwise init highmem will reserve it again */
+	free_early(ramdisk_image, ramdisk_image+ramdisk_size);
 }
 
 #endif /* CONFIG_BLK_DEV_INITRD */
@@ -813,10 +816,6 @@ void __init setup_arch(char **cmdline_p)
 		init_ohci1394_dma_on_all_controllers();
 #endif
 
-	remapped_pgdat_init();
-	sparse_init();
-	zone_sizes_init();
-
 	/*
 	 * NOTE: at this point the bootmem allocator is fully available.
 	 */
@@ -825,6 +824,10 @@ void __init setup_arch(char **cmdline_p)
 	relocate_initrd();
 #endif
 
+	remapped_pgdat_init();
+	sparse_init();
+	zone_sizes_init();
+
 	paravirt_post_allocator_init();
 
 	dmi_scan_machine();

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: replace shrink pages with remove_active_ranges v2
  2008-06-14  3:05 [PATCH] x86: replace shrink pages with remove_active_ranges v2 Yinghai Lu
  2008-06-14  3:07 ` [PATCH] x86: cleanup reloated_initrd Yinghai Lu
@ 2008-06-14  6:23 ` Ingo Molnar
  2008-06-14  7:56 ` [PATCH] x86: use add_highpages_with_active_regions for high pages init Yinghai Lu
  2 siblings, 0 replies; 22+ messages in thread
From: Ingo Molnar @ 2008-06-14  6:23 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: H. Peter Anvin, Thomas Gleixner, Andrew Morton,
	linux-kernel@vger.kernel.org


* Yinghai Lu <yhlu.kernel@gmail.com> wrote:

> in case we have kva before ramdisk on node, we still need to use
> those ranges.
> 
> v2: reserve_early kva ram area, in case there are holes in highmem, to avoid
>     those area could be treat as free high pages.

applied to tip/x86/mpprarse - thanks Yinghai.

	Ingo

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH] x86: use add_highpages_with_active_regions for high pages init
  2008-06-14  3:05 [PATCH] x86: replace shrink pages with remove_active_ranges v2 Yinghai Lu
  2008-06-14  3:07 ` [PATCH] x86: cleanup reloated_initrd Yinghai Lu
  2008-06-14  6:23 ` [PATCH] x86: replace shrink pages with remove_active_ranges v2 Ingo Molnar
@ 2008-06-14  7:56 ` Yinghai Lu
  2008-06-14  8:23   ` Ingo Molnar
  2008-06-15  1:32   ` [PATCH] x86: use add_highpages_with_active_regions for high pages init v2 Yinghai Lu
  2 siblings, 2 replies; 22+ messages in thread
From: Yinghai Lu @ 2008-06-14  7:56 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, Andrew Morton,
	Ying Huang
  Cc: linux-kernel@vger.kernel.org


use early_node_map to init high pages, so can remove page_is_ram and
page_is_reserved_early in the big loop with add_one_highpage

also remove the page_is_reserved_early that is not needed.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 4f2cd5d..a87843b 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -612,17 +612,6 @@ void __init free_early(u64 start, u64 end)
 	early_res[j - 1].end = 0;
 }
 
-int __init page_is_reserved_early(unsigned long pagenr)
-{
-	u64 start = (u64)pagenr << PAGE_SHIFT;
-	int i;
-	struct early_res *r;
-
-	i = find_overlapped_early(start, start + PAGE_SIZE);
-	r = &early_res[i];
-	return (i < MAX_EARLY_RES && r->end);
-}
-
 void __init early_res_to_bootmem(u64 start, u64 end)
 {
 	int i;
diff --git a/arch/x86/mm/discontig_32.c b/arch/x86/mm/discontig_32.c
index c6ce6a5..5444be2 100644
--- a/arch/x86/mm/discontig_32.c
+++ b/arch/x86/mm/discontig_32.c
@@ -100,7 +100,6 @@ unsigned long node_memmap_size_bytes(int nid, unsigned long start_pfn,
 #endif
 
 extern unsigned long find_max_low_pfn(void);
-extern void add_one_highpage_init(struct page *, int, int);
 extern unsigned long highend_pfn, highstart_pfn;
 
 #define LARGE_PAGE_BYTES (PTRS_PER_PTE * PAGE_SIZE)
@@ -407,10 +406,10 @@ void __init set_highmem_pages_init(int bad_ppro)
 {
 #ifdef CONFIG_HIGHMEM
 	struct zone *zone;
-	struct page *page;
+	int nid;
 
 	for_each_zone(zone) {
-		unsigned long node_pfn, zone_start_pfn, zone_end_pfn;
+		unsigned long zone_start_pfn, zone_end_pfn;
 
 		if (!is_highmem(zone))
 			continue;
@@ -418,16 +417,12 @@ void __init set_highmem_pages_init(int bad_ppro)
 		zone_start_pfn = zone->zone_start_pfn;
 		zone_end_pfn = zone_start_pfn + zone->spanned_pages;
 
+		nid = zone_to_nid(zone);
 		printk("Initializing %s for node %d (%08lx:%08lx)\n",
-				zone->name, zone_to_nid(zone),
-				zone_start_pfn, zone_end_pfn);
-
-		for (node_pfn = zone_start_pfn; node_pfn < zone_end_pfn; node_pfn++) {
-			if (!pfn_valid(node_pfn))
-				continue;
-			page = pfn_to_page(node_pfn);
-			add_one_highpage_init(page, node_pfn, bad_ppro);
-		}
+				zone->name, nid, zone_start_pfn, zone_end_pfn);
+
+		add_highpages_with_active_regions(nid, zone_start_pfn,
+				 zone_end_pfn, bad_ppro);
 	}
 	totalram_pages += totalhigh_pages;
 #endif
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 4f308fa..502b2a9 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -294,8 +294,7 @@ static void __init permanent_kmaps_init(pgd_t *pgd_base)
 
 void __init add_one_highpage_init(struct page *page, int pfn, int bad_ppro)
 {
-	if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn)) &&
-	    !page_is_reserved_early(pfn)) {
+	if (!(bad_ppro && page_kills_ppro(pfn))) {
 		ClearPageReserved(page);
 		init_page_count(page);
 		__free_page(page);
@@ -307,15 +306,9 @@ void __init add_one_highpage_init(struct page *page, int pfn, int bad_ppro)
 #ifndef CONFIG_NUMA
 static void __init set_highmem_pages_init(int bad_ppro)
 {
-	int pfn;
+	add_highpages_with_active_regions(0, highstart_pfn, highend_pfn,
+						bad_ppro);
 
-	for (pfn = highstart_pfn; pfn < highend_pfn; pfn++) {
-		/*
-		 * Holes under sparsemem might not have no mem_map[]:
-		 */
-		if (pfn_valid(pfn))
-			add_one_highpage_init(pfn_to_page(pfn), pfn, bad_ppro);
-	}
 	totalram_pages += totalhigh_pages;
 }
 #endif /* !CONFIG_NUMA */
diff --git a/include/asm-x86/e820.h b/include/asm-x86/e820.h
index a5959e3..b336666 100644
--- a/include/asm-x86/e820.h
+++ b/include/asm-x86/e820.h
@@ -86,7 +86,6 @@ extern u64 find_e820_area_size(u64 start, u64 *sizep, u64 align);
 extern void reserve_early(u64 start, u64 end, char *name);
 extern void free_early(u64 start, u64 end);
 extern void early_res_to_bootmem(u64 start, u64 end);
-extern int page_is_reserved_early(unsigned long pagenr);
 extern u64 early_reserve_e820(u64 startt, u64 sizet, u64 align);
 
 extern unsigned long e820_end_of_ram(void);
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 77b5ec6..df4c0fa 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1010,6 +1010,8 @@ extern unsigned long find_min_pfn_with_active_regions(void);
 extern unsigned long find_max_pfn_with_active_regions(void);
 extern void free_bootmem_with_active_regions(int nid,
 						unsigned long max_low_pfn);
+extern void add_highpages_with_active_regions(int nid, unsigned long start_pfn,
+					unsigned long end_pfn, int bad_ppro);
 extern void sparse_memory_present_with_active_regions(int nid);
 #ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
 extern int early_pfn_to_nid(unsigned long pfn);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 17ef776..5cd82a6 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2939,6 +2939,30 @@ void __init free_bootmem_with_active_regions(int nid,
 	}
 }
 
+extern void add_one_highpage_init(struct page *, int, int);
+void __init add_highpages_with_active_regions(int nid, unsigned long start_pfn,
+					unsigned long end_pfn, int bad_ppro)
+{
+	int i;
+	int node_pfn;
+	struct page *page;
+	unsigned long final_start_pfn, final_end_pfn;
+
+	for_each_active_range_index_in_nid(i, nid){
+		final_start_pfn = max(start_pfn, early_node_map[i].start_pfn);
+		final_end_pfn = min(end_pfn, early_node_map[i].end_pfn);
+		if (final_start_pfn >= final_end_pfn)
+			continue;
+
+		for (node_pfn = final_start_pfn; node_pfn < final_end_pfn;
+		     node_pfn++) {
+			if (!pfn_valid(node_pfn))
+				continue;
+			page = pfn_to_page(node_pfn);
+			add_one_highpage_init(page, node_pfn, bad_ppro);
+		}
+	}
+}
 /**
  * sparse_memory_present_with_active_regions - Call memory_present for each active range
  * @nid: The node to call memory_present for. If MAX_NUMNODES, all nodes will be used.

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: use add_highpages_with_active_regions for high pages init
  2008-06-14  7:56 ` [PATCH] x86: use add_highpages_with_active_regions for high pages init Yinghai Lu
@ 2008-06-14  8:23   ` Ingo Molnar
  2008-06-14  8:50     ` Ingo Molnar
  2008-06-14  9:05     ` Yinghai Lu
  2008-06-15  1:32   ` [PATCH] x86: use add_highpages_with_active_regions for high pages init v2 Yinghai Lu
  1 sibling, 2 replies; 22+ messages in thread
From: Ingo Molnar @ 2008-06-14  8:23 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: H. Peter Anvin, Thomas Gleixner, Andrew Morton, Ying Huang,
	linux-kernel@vger.kernel.org


* Yinghai Lu <yhlu.kernel@gmail.com> wrote:

> use early_node_map to init high pages, so can remove page_is_ram and 
> page_is_reserved_early in the big loop with add_one_highpage
> 
> also remove the page_is_reserved_early that is not needed.

applied to tip/x86/mpparse for testing, thanks.

Andrew: mm/page_alloc.c modification.

two small nits:

checkpatch warned about:

> +	for_each_active_range_index_in_nid(i, nid){

that should be ') {' (note the extra space).

another thing checkpatch noticed:

> +extern void add_one_highpage_init(struct page *, int, int);
> +void __init add_highpages_with_active_regions(int nid, unsigned long start_p$

we want externs in header files.

	Ingo

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: cleanup reloated_initrd
  2008-06-14  3:07 ` [PATCH] x86: cleanup reloated_initrd Yinghai Lu
@ 2008-06-14  8:28   ` Ingo Molnar
  2008-06-14 18:41   ` H. Peter Anvin
  1 sibling, 0 replies; 22+ messages in thread
From: Ingo Molnar @ 2008-06-14  8:28 UTC (permalink / raw)
  To: Yinghai Lu; +Cc: H. Peter Anvin, Thomas Gleixner, linux-kernel@vger.kernel.org


* Yinghai Lu <yhlu.kernel@gmail.com> wrote:

> 1. move that before zone_sizes_init ...
> 2. add free_early for one old one, otherwise it will be be reserved again when
>    init highmem.

applied to tip/x86/mpparse, thanks.

	Ingo

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: use add_highpages_with_active_regions for high pages init
  2008-06-14  8:23   ` Ingo Molnar
@ 2008-06-14  8:50     ` Ingo Molnar
  2008-06-14  8:59       ` Ingo Molnar
  2008-06-14  9:05     ` Yinghai Lu
  1 sibling, 1 reply; 22+ messages in thread
From: Ingo Molnar @ 2008-06-14  8:50 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: H. Peter Anvin, Thomas Gleixner, Andrew Morton, Ying Huang,
	linux-kernel@vger.kernel.org


* Ingo Molnar <mingo@elte.hu> wrote:

> > use early_node_map to init high pages, so can remove page_is_ram and 
> > page_is_reserved_early in the big loop with add_one_highpage
> > 
> > also remove the page_is_reserved_early that is not needed.
> 
> applied to tip/x86/mpparse for testing, thanks.
> 
> Andrew: mm/page_alloc.c modification.

i ended up doing the change below.

'bad_ppro' looked quite ugly in mm/page_alloc.c, and there was also a 
64-bit build failure, so i moved the function out of page_alloc.c, into 
the 32-bit x86 code.

	Ingo

------------->
commit 30847a7f5650248cd8435b7646eef0b9cfd66095
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sat Jun 14 10:41:09 2008 +0200

    x86: move add_highpages_with_active_regions() to 32-bit
    
    this is an x86 32-bit highmem-only function, so move it out of
    mm/page_alloc.c.
    
    this also solves this 64-bit build failure:
    
    mm/built-in.o: In function `add_highpages_with_active_regions':
    (.init.text+0x1833): undefined reference to `add_one_highpage_init'

diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 6652f14..3400289 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -287,7 +287,8 @@ static void __init permanent_kmaps_init(pgd_t *pgd_base)
 	pkmap_page_table = pte;
 }
 
-void __init add_one_highpage_init(struct page *page, int pfn, int bad_ppro)
+static void __init
+add_one_highpage_init(struct page *page, int pfn, int bad_ppro)
 {
 	if (!(bad_ppro && page_kills_ppro(pfn))) {
 		ClearPageReserved(page);
@@ -298,6 +299,30 @@ void __init add_one_highpage_init(struct page *page, int pfn, int bad_ppro)
 		SetPageReserved(page);
 }
 
+void __init add_highpages_with_active_regions(int nid, unsigned long start_pfn,
+					unsigned long end_pfn, int bad_ppro)
+{
+	int i;
+	int node_pfn;
+	struct page *page;
+	unsigned long final_start_pfn, final_end_pfn;
+
+	for_each_active_range_index_in_nid(i, nid) {
+		final_start_pfn = max(start_pfn, early_node_map[i].start_pfn);
+		final_end_pfn = min(end_pfn, early_node_map[i].end_pfn);
+		if (final_start_pfn >= final_end_pfn)
+			continue;
+
+		for (node_pfn = final_start_pfn; node_pfn < final_end_pfn;
+		     node_pfn++) {
+			if (!pfn_valid(node_pfn))
+				continue;
+			page = pfn_to_page(node_pfn);
+			add_one_highpage_init(page, node_pfn, bad_ppro);
+		}
+	}
+}
+
 #ifndef CONFIG_NUMA
 static void __init set_highmem_pages_init(int bad_ppro)
 {
diff --git a/include/asm-x86/highmem.h b/include/asm-x86/highmem.h
index e153f3b..85c4fea 100644
--- a/include/asm-x86/highmem.h
+++ b/include/asm-x86/highmem.h
@@ -74,6 +74,9 @@ struct page *kmap_atomic_to_page(void *ptr);
 
 #define flush_cache_kmaps()	do { } while (0)
 
+extern void add_highpages_with_active_regions(int nid, unsigned long start_pfn,
+					unsigned long end_pfn, int bad_ppro);
+
 #endif /* __KERNEL__ */
 
 #endif /* _ASM_HIGHMEM_H */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 4a5d33f..c4f6553 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1010,8 +1010,6 @@ extern unsigned long find_min_pfn_with_active_regions(void);
 extern unsigned long find_max_pfn_with_active_regions(void);
 extern void free_bootmem_with_active_regions(int nid,
 						unsigned long max_low_pfn);
-extern void add_highpages_with_active_regions(int nid, unsigned long start_pfn,
-					unsigned long end_pfn, int bad_ppro);
 extern void sparse_memory_present_with_active_regions(int nid);
 #ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
 extern int early_pfn_to_nid(unsigned long pfn);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index ad1b684..26a028c 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2955,30 +2955,6 @@ void __init free_bootmem_with_active_regions(int nid,
 	}
 }
 
-extern void add_one_highpage_init(struct page *, int, int);
-void __init add_highpages_with_active_regions(int nid, unsigned long start_pfn,
-					unsigned long end_pfn, int bad_ppro)
-{
-	int i;
-	int node_pfn;
-	struct page *page;
-	unsigned long final_start_pfn, final_end_pfn;
-
-	for_each_active_range_index_in_nid(i, nid) {
-		final_start_pfn = max(start_pfn, early_node_map[i].start_pfn);
-		final_end_pfn = min(end_pfn, early_node_map[i].end_pfn);
-		if (final_start_pfn >= final_end_pfn)
-			continue;
-
-		for (node_pfn = final_start_pfn; node_pfn < final_end_pfn;
-		     node_pfn++) {
-			if (!pfn_valid(node_pfn))
-				continue;
-			page = pfn_to_page(node_pfn);
-			add_one_highpage_init(page, node_pfn, bad_ppro);
-		}
-	}
-}
 /**
  * sparse_memory_present_with_active_regions - Call memory_present for each active range
  * @nid: The node to call memory_present for. If MAX_NUMNODES, all nodes will be used.

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: use add_highpages_with_active_regions for high pages init
  2008-06-14  8:50     ` Ingo Molnar
@ 2008-06-14  8:59       ` Ingo Molnar
  0 siblings, 0 replies; 22+ messages in thread
From: Ingo Molnar @ 2008-06-14  8:59 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: H. Peter Anvin, Thomas Gleixner, Andrew Morton, Ying Huang,
	linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 547 bytes --]


* Ingo Molnar <mingo@elte.hu> wrote:

> > Andrew: mm/page_alloc.c modification.
> 
> i ended up doing the change below.
> 
> 'bad_ppro' looked quite ugly in mm/page_alloc.c, and there was also a 
> 64-bit build failure, so i moved the function out of page_alloc.c, 
> into the 32-bit x86 code.

hm, this doesnt work very well with non-NUMA 32-bit highmem configs as 
the attached one. There no for_each_active_range_index_in_nid(), etc. 
Might make sense to provide obvious definitions for these NUMA functions 
for the non-numa case too?

	Ingo

[-- Attachment #2: config --]
[-- Type: text/plain, Size: 19771 bytes --]

#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.26-rc6
# Sat Jun 14 10:57:33 2008
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
# CONFIG_X86_64 is not set
CONFIG_X86=y
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
# CONFIG_GENERIC_LOCKBREAK is not set
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_FAST_CMPXCHG_LOCAL=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_HWEIGHT=y
# CONFIG_GENERIC_GPIO is not set
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
# CONFIG_GENERIC_TIME_VSYSCALL is not set
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
# CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
# CONFIG_ZONE_DMA32 is not set
CONFIG_ARCH_POPULATES_NODE_MAP=y
# CONFIG_AUDIT_ARCH is not set
CONFIG_ARCH_SUPPORTS_AOUT=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_X86_SMP=y
CONFIG_X86_32_SMP=y
CONFIG_X86_HT=y
CONFIG_X86_BIOS_REBOOT=y
CONFIG_X86_TRAMPOLINE=y
CONFIG_KTIME_SCALAR=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
# CONFIG_SYSVIPC is not set
CONFIG_BSD_PROCESS_ACCT=y
# CONFIG_BSD_PROCESS_ACCT_V3 is not set
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=20
# CONFIG_CGROUPS is not set
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_GROUP_SCHED=y
# CONFIG_FAIR_GROUP_SCHED is not set
CONFIG_RT_GROUP_SCHED=y
CONFIG_USER_SCHED=y
# CONFIG_CGROUP_SCHED is not set
# CONFIG_SYSFS_DEPRECATED_V2 is not set
# CONFIG_RELAY is not set
# CONFIG_NAMESPACES is not set
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
CONFIG_EMBEDDED=y
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_SYSCTL_SYSCALL_CHECK=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
# CONFIG_KALLSYMS_EXTRA_PASS is not set
# CONFIG_HOTPLUG is not set
# CONFIG_PRINTK is not set
CONFIG_BUG=y
# CONFIG_ELF_CORE is not set
# CONFIG_PCSPKR_PLATFORM is not set
CONFIG_COMPAT_BRK=y
# CONFIG_BASE_FULL is not set
# CONFIG_FUTEX is not set
CONFIG_ANON_INODES=y
# CONFIG_EPOLL is not set
CONFIG_SIGNALFD=y
# CONFIG_TIMERFD is not set
# CONFIG_EVENTFD is not set
CONFIG_SHMEM=y
# CONFIG_VM_EVENT_COUNTERS is not set
CONFIG_SLAB=y
# CONFIG_SLUB is not set
# CONFIG_SLOB is not set
# CONFIG_PROFILING is not set
# CONFIG_MARKERS is not set
CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
# CONFIG_HAVE_DMA_ATTRS is not set
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_HAVE_IMMEDIATE=y
CONFIG_IMMEDIATE=y
CONFIG_SLABINFO=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=1
# CONFIG_MODULES is not set
# CONFIG_BLOCK is not set
CONFIG_PREEMPT_NOTIFIERS=y
CONFIG_CLASSIC_RCU=y

#
# Processor type and features
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_SMP=y
CONFIG_X86_PC=y
# CONFIG_X86_ELAN is not set
# CONFIG_X86_VOYAGER is not set
# CONFIG_X86_VISWS is not set
# CONFIG_X86_GENERICARCH is not set
# CONFIG_X86_RDC321X is not set
# CONFIG_X86_VSMP is not set
# CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER is not set
# CONFIG_PARAVIRT_GUEST is not set
# CONFIG_M386 is not set
CONFIG_M486=y
# CONFIG_M586 is not set
# CONFIG_M586TSC is not set
# CONFIG_M586MMX is not set
# CONFIG_M686 is not set
# CONFIG_MPENTIUMII is not set
# CONFIG_MPENTIUMIII is not set
# CONFIG_MPENTIUMM is not set
# CONFIG_MPENTIUM4 is not set
# CONFIG_MK6 is not set
# CONFIG_MK7 is not set
# CONFIG_MK8 is not set
# CONFIG_MCRUSOE is not set
# CONFIG_MEFFICEON is not set
# CONFIG_MWINCHIPC6 is not set
# CONFIG_MWINCHIP2 is not set
# CONFIG_MWINCHIP3D is not set
# CONFIG_MGEODEGX1 is not set
# CONFIG_MGEODE_LX is not set
# CONFIG_MCYRIXIII is not set
# CONFIG_MVIAC3_2 is not set
# CONFIG_MVIAC7 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
# CONFIG_GENERIC_CPU is not set
CONFIG_X86_GENERIC=y
CONFIG_X86_CPU=y
CONFIG_X86_CMPXCHG=y
CONFIG_X86_L1_CACHE_SHIFT=7
CONFIG_X86_XADD=y
CONFIG_X86_PPRO_FENCE=y
CONFIG_X86_F00F_BUG=y
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_INVLPG=y
CONFIG_X86_BSWAP=y
CONFIG_X86_POPAD_OK=y
CONFIG_X86_ALIGNMENT_16=y
CONFIG_X86_INTEL_USERCOPY=y
CONFIG_X86_MINIMUM_CPU_FAMILY=4
CONFIG_X86_DS=y
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
# CONFIG_DMI is not set
# CONFIG_IOMMU_HELPER is not set
CONFIG_NR_CPUS=8
# CONFIG_SCHED_SMT is not set
# CONFIG_SCHED_MC is not set
# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
# CONFIG_X86_MCE is not set
CONFIG_VM86=y
CONFIG_TOSHIBA=y
# CONFIG_I8K is not set
# CONFIG_X86_REBOOTFIXUPS is not set
CONFIG_MICROCODE=y
CONFIG_MICROCODE_OLD_INTERFACE=y
# CONFIG_X86_MSR is not set
# CONFIG_X86_CPUID is not set
# CONFIG_NOHIGHMEM is not set
CONFIG_HIGHMEM4G=y
# CONFIG_HIGHMEM64G is not set
CONFIG_VMSPLIT_3G=y
# CONFIG_VMSPLIT_3G_OPT is not set
# CONFIG_VMSPLIT_2G is not set
# CONFIG_VMSPLIT_2G_OPT is not set
# CONFIG_VMSPLIT_1G is not set
CONFIG_PAGE_OFFSET=0xC0000000
CONFIG_HIGHMEM=y
CONFIG_NEED_NODE_MEMMAP_SIZE=y
CONFIG_ARCH_FLATMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ILLEGAL_POINTER_VALUE=0
CONFIG_SELECT_MEMORY_MODEL=y
# CONFIG_FLATMEM_MANUAL is not set
# CONFIG_DISCONTIGMEM_MANUAL is not set
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_STATIC=y
# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_RESOURCES_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_VIRT_TO_BUS=y
CONFIG_HIGHPTE=y
CONFIG_MATH_EMULATION=y
# CONFIG_MTRR is not set
# CONFIG_IRQBALANCE is not set
# CONFIG_SECCOMP is not set
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000
CONFIG_SCHED_HRTICK=y
CONFIG_KEXEC=y
# CONFIG_CRASH_DUMP is not set
CONFIG_PHYSICAL_START=0x100000
CONFIG_RELOCATABLE=y
CONFIG_PHYSICAL_ALIGN=0x100000
CONFIG_COMPAT_VDSO=y
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y

#
# Power management options
#
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
# CONFIG_SUSPEND is not set

#
# CPU Frequency scaling
#
# CONFIG_CPU_FREQ is not set
# CONFIG_CPU_IDLE is not set

#
# Bus options (PCI etc.)
#
# CONFIG_PCI is not set
# CONFIG_ARCH_SUPPORTS_MSI is not set
CONFIG_ISA_DMA_API=y
CONFIG_ISA=y
# CONFIG_EISA is not set
CONFIG_MCA=y
CONFIG_MCA_LEGACY=y
# CONFIG_MCA_PROC_FS is not set
# CONFIG_SCx200 is not set
# CONFIG_OLPC is not set

#
# Executable file formats / Emulations
#
# CONFIG_BINFMT_ELF is not set
CONFIG_BINFMT_AOUT=y
CONFIG_BINFMT_MISC=y

#
# Networking
#
# CONFIG_NET is not set

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
# CONFIG_DEBUG_DRIVER is not set
CONFIG_DEBUG_DEVRES=y
# CONFIG_SYS_HYPERVISOR is not set
CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
CONFIG_MTD_CONCAT=y
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_REDBOOT_PARTS=y
CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
CONFIG_MTD_REDBOOT_PARTS_READONLY=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_AR7_PARTS=y

#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=y
CONFIG_MTD_OOPS=y

#
# RAM/ROM/Flash chip drivers
#
# CONFIG_MTD_CFI is not set
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
# CONFIG_MTD_RAM is not set
CONFIG_MTD_ROM=y
# CONFIG_MTD_ABSENT is not set

#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_START=0x8000000
CONFIG_MTD_PHYSMAP_LEN=0x0
CONFIG_MTD_PHYSMAP_BANKWIDTH=2
# CONFIG_MTD_TS5500 is not set
# CONFIG_MTD_PLATRAM is not set

#
# Self-contained MTD device drivers
#
# CONFIG_MTD_SLRAM is not set
CONFIG_MTD_PHRAM=y
# CONFIG_MTD_MTDRAM is not set

#
# Disk-On-Chip Device Drivers
#
CONFIG_MTD_DOC2000=y
CONFIG_MTD_DOC2001=y
CONFIG_MTD_DOC2001PLUS=y
CONFIG_MTD_DOCPROBE=y
CONFIG_MTD_DOCECC=y
CONFIG_MTD_DOCPROBE_ADVANCED=y
CONFIG_MTD_DOCPROBE_ADDRESS=0x0000
CONFIG_MTD_DOCPROBE_HIGH=y
CONFIG_MTD_DOCPROBE_55AA=y
# CONFIG_MTD_NAND is not set
CONFIG_MTD_NAND_IDS=y
CONFIG_MTD_ONENAND=y
# CONFIG_MTD_ONENAND_VERIFY_WRITE is not set
# CONFIG_MTD_ONENAND_OTP is not set
CONFIG_MTD_ONENAND_2X_PROGRAM=y
# CONFIG_MTD_ONENAND_SIM is not set

#
# UBI - Unsorted block images
#
# CONFIG_MTD_UBI is not set
# CONFIG_PARPORT is not set
# CONFIG_PNP is not set
CONFIG_MISC_DEVICES=y
CONFIG_EEPROM_93CX6=y
CONFIG_ENCLOSURE_SERVICES=y
CONFIG_HAVE_IDE=y

#
# SCSI device support
#
# CONFIG_SCSI_DMA is not set
# CONFIG_SCSI_NETLINK is not set
CONFIG_MACINTOSH_DRIVERS=y
# CONFIG_MAC_EMUMOUSEBTN is not set
# CONFIG_PHONE is not set

#
# Input device support
#
# CONFIG_INPUT is not set

#
# Hardware I/O ports
#
# CONFIG_SERIO is not set
CONFIG_GAMEPORT=y
CONFIG_GAMEPORT_NS558=y
CONFIG_GAMEPORT_L4=y

#
# Character devices
#
# CONFIG_VT is not set
CONFIG_DEVKMEM=y
# CONFIG_SERIAL_NONSTANDARD is not set

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_FOURPORT=y
CONFIG_SERIAL_8250_ACCENT=y
# CONFIG_SERIAL_8250_BOCA is not set
CONFIG_SERIAL_8250_EXAR_ST16C554=y
# CONFIG_SERIAL_8250_HUB6 is not set
# CONFIG_SERIAL_8250_SHARE_IRQ is not set
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
CONFIG_SERIAL_8250_MCA=y

#
# Non-8250 serial port support
#
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_CONSOLE_POLL=y
CONFIG_UNIX98_PTYS=y
# CONFIG_LEGACY_PTYS is not set
# CONFIG_IPMI_HANDLER is not set
CONFIG_HW_RANDOM=y
# CONFIG_HW_RANDOM_VIA is not set
# CONFIG_NVRAM is not set
# CONFIG_DTLK is not set
CONFIG_R3964=y
CONFIG_MWAVE=y
CONFIG_PC8736x_GPIO=y
CONFIG_NSC_GPIO=y
# CONFIG_CS5535_GPIO is not set
# CONFIG_HANGCHECK_TIMER is not set
CONFIG_TCG_TPM=y
# CONFIG_TCG_NSC is not set
# CONFIG_TCG_ATMEL is not set
# CONFIG_TELCLOCK is not set
CONFIG_DEVPORT=y
# CONFIG_I2C is not set
# CONFIG_SPI is not set
CONFIG_W1=y

#
# 1-wire Bus Masters
#

#
# 1-wire Slaves
#
# CONFIG_W1_SLAVE_THERM is not set
CONFIG_W1_SLAVE_SMEM=y
CONFIG_W1_SLAVE_DS2433=y
CONFIG_W1_SLAVE_DS2433_CRC=y
# CONFIG_W1_SLAVE_DS2760 is not set
# CONFIG_POWER_SUPPLY is not set
CONFIG_HWMON=y
CONFIG_HWMON_VID=y
CONFIG_SENSORS_ABITUGURU=y
# CONFIG_SENSORS_ABITUGURU3 is not set
# CONFIG_SENSORS_F71805F is not set
CONFIG_SENSORS_F71882FG=y
CONFIG_SENSORS_CORETEMP=y
CONFIG_SENSORS_IT87=y
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_PC87427 is not set
# CONFIG_SENSORS_SMSC47M1 is not set
# CONFIG_SENSORS_SMSC47B397 is not set
CONFIG_SENSORS_VT1211=y
CONFIG_SENSORS_W83627HF=y
# CONFIG_SENSORS_W83627EHF is not set
CONFIG_HWMON_DEBUG_CHIP=y
CONFIG_THERMAL=y
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_NOWAYOUT=y

#
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
CONFIG_ACQUIRE_WDT=y
CONFIG_ADVANTECH_WDT=y
# CONFIG_SC520_WDT is not set
# CONFIG_EUROTECH_WDT is not set
CONFIG_IB700_WDT=y
CONFIG_IBMASR=y
# CONFIG_WAFER_WDT is not set
# CONFIG_IT8712F_WDT is not set
# CONFIG_HP_WATCHDOG is not set
# CONFIG_SC1200_WDT is not set
# CONFIG_PC87413_WDT is not set
CONFIG_60XX_WDT=y
# CONFIG_SBC8360_WDT is not set
CONFIG_SBC7240_WDT=y
# CONFIG_CPU5_WDT is not set
# CONFIG_SMSC37B787_WDT is not set
CONFIG_W83627HF_WDT=y
CONFIG_W83697HF_WDT=y
CONFIG_W83877F_WDT=y
# CONFIG_W83977F_WDT is not set
# CONFIG_MACHZ_WDT is not set
CONFIG_SBC_EPX_C3_WATCHDOG=y

#
# ISA-based Watchdog Cards
#
CONFIG_PCWATCHDOG=y
CONFIG_MIXCOMWD=y
CONFIG_WDT=y
CONFIG_WDT_501=y

#
# Sonics Silicon Backplane
#
CONFIG_SSB_POSSIBLE=y
CONFIG_SSB=y
# CONFIG_SSB_SILENT is not set
CONFIG_SSB_DEBUG=y

#
# Multifunction device drivers
#
# CONFIG_MFD_SM501 is not set
CONFIG_HTC_PASIC3=y

#
# Multimedia devices
#

#
# Multimedia core support
#
# CONFIG_VIDEO_DEV is not set
# CONFIG_VIDEO_MEDIA is not set

#
# Multimedia drivers
#
CONFIG_DAB=y

#
# Graphics support
#
# CONFIG_VGASTATE is not set
# CONFIG_VIDEO_OUTPUT_CONTROL is not set
CONFIG_FB=y
# CONFIG_FIRMWARE_EDID is not set
# CONFIG_FB_DDC is not set
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
CONFIG_FB_SYS_FILLRECT=y
CONFIG_FB_SYS_COPYAREA=y
CONFIG_FB_SYS_IMAGEBLIT=y
# CONFIG_FB_FOREIGN_ENDIAN is not set
CONFIG_FB_SYS_FOPS=y
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_HECUBA=y
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
# CONFIG_FB_BACKLIGHT is not set
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y

#
# Frame buffer hardware drivers
#
CONFIG_FB_ARC=y
# CONFIG_FB_VGA16 is not set
# CONFIG_FB_VESA is not set
CONFIG_FB_EFI=y
CONFIG_FB_N411=y
# CONFIG_FB_HGA is not set
CONFIG_FB_S1D13XXX=y
# CONFIG_FB_VIRTUAL is not set
CONFIG_BACKLIGHT_LCD_SUPPORT=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_CORGI is not set

#
# Display device support
#
CONFIG_DISPLAY_SUPPORT=y

#
# Display hardware drivers
#
# CONFIG_LOGO is not set

#
# Sound
#
# CONFIG_SOUND is not set
CONFIG_USB_SUPPORT=y
# CONFIG_USB_ARCH_HAS_HCD is not set
# CONFIG_USB_ARCH_HAS_OHCI is not set
# CONFIG_USB_ARCH_HAS_EHCI is not set
# CONFIG_USB_OTG_WHITELIST is not set
# CONFIG_USB_OTG_BLACKLIST_HUB is not set

#
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
#
# CONFIG_USB_GADGET is not set
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
CONFIG_MMC_UNSAFE_RESUME=y

#
# MMC/SD Card Drivers
#
# CONFIG_SDIO_UART is not set
CONFIG_MMC_TEST=y

#
# MMC/SD Host Controller Drivers
#
CONFIG_MMC_WBSD=y
CONFIG_MEMSTICK=y
CONFIG_MEMSTICK_DEBUG=y

#
# MemoryStick drivers
#
CONFIG_MEMSTICK_UNSAFE_RESUME=y

#
# MemoryStick Host Controller Drivers
#
CONFIG_NEW_LEDS=y
# CONFIG_LEDS_CLASS is not set

#
# LED drivers
#

#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
# CONFIG_LEDS_TRIGGER_TIMER is not set
# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
# CONFIG_ACCESSIBILITY is not set
CONFIG_EDAC=y

#
# Reporting subsystems
#
# CONFIG_EDAC_DEBUG is not set
CONFIG_EDAC_MM_EDAC=y
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set

#
# RTC interfaces
#
# CONFIG_RTC_INTF_SYSFS is not set
# CONFIG_RTC_INTF_PROC is not set
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
CONFIG_RTC_DRV_TEST=y

#
# SPI RTC drivers
#

#
# Platform RTC drivers
#
CONFIG_RTC_DRV_CMOS=y
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
CONFIG_RTC_DRV_DS1742=y
CONFIG_RTC_DRV_STK17TA8=y
# CONFIG_RTC_DRV_M48T86 is not set
CONFIG_RTC_DRV_M48T59=y
CONFIG_RTC_DRV_V3020=y

#
# on-CPU RTC drivers
#
# CONFIG_UIO is not set

#
# Firmware Drivers
#
# CONFIG_EDD is not set
CONFIG_DELL_RBU=y
CONFIG_DCDBAS=y
# CONFIG_ISCSI_IBFT_FIND is not set

#
# File systems
#
CONFIG_FS_POSIX_ACL=y
CONFIG_DNOTIFY=y
# CONFIG_INOTIFY is not set
CONFIG_QUOTA=y
# CONFIG_PRINT_QUOTA_WARNING is not set
CONFIG_QFMT_V1=y
# CONFIG_QFMT_V2 is not set
CONFIG_QUOTACTL=y
CONFIG_AUTOFS_FS=y
CONFIG_AUTOFS4_FS=y
# CONFIG_FUSE_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
# CONFIG_PROC_SYSCTL is not set
CONFIG_SYSFS=y
# CONFIG_TMPFS is not set
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
# CONFIG_CONFIGFS_FS is not set

#
# Miscellaneous filesystems
#
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
# CONFIG_JFFS2_FS_WRITEBUFFER is not set
# CONFIG_JFFS2_SUMMARY is not set
CONFIG_JFFS2_FS_XATTR=y
CONFIG_JFFS2_FS_POSIX_ACL=y
# CONFIG_JFFS2_FS_SECURITY is not set
CONFIG_JFFS2_COMPRESSION_OPTIONS=y
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_LZO=y
CONFIG_JFFS2_RTIME=y
CONFIG_JFFS2_RUBIN=y
CONFIG_JFFS2_CMODE_NONE=y
# CONFIG_JFFS2_CMODE_PRIORITY is not set
# CONFIG_JFFS2_CMODE_SIZE is not set
# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
# CONFIG_NLS is not set

#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_FRAME_WARN=1024
CONFIG_MAGIC_SYSRQ=y
CONFIG_UNUSED_SYMBOLS=y
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_SHIRQ=y
# CONFIG_DETECT_SOFTLOCKUP is not set
CONFIG_SCHED_DEBUG=y
# CONFIG_SCHEDSTATS is not set
# CONFIG_TIMER_STATS is not set
CONFIG_DEBUG_OBJECTS=y
CONFIG_DEBUG_OBJECTS_SELFTEST=y
# CONFIG_DEBUG_OBJECTS_FREE is not set
# CONFIG_DEBUG_OBJECTS_TIMERS is not set
# CONFIG_DEBUG_SLAB is not set
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_PROVE_LOCKING=y
CONFIG_LOCKDEP=y
# CONFIG_LOCK_STAT is not set
# CONFIG_DEBUG_LOCKDEP is not set
CONFIG_TRACE_IRQFLAGS=y
CONFIG_DEBUG_SPINLOCK_SLEEP=y
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
CONFIG_STACKTRACE=y
CONFIG_DEBUG_KOBJECT=y
CONFIG_DEBUG_HIGHMEM=y
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_INFO is not set
CONFIG_DEBUG_VM=y
CONFIG_DEBUG_WRITECOUNT=y
# CONFIG_DEBUG_LIST is not set
CONFIG_DEBUG_SG=y
CONFIG_FRAME_POINTER=y
CONFIG_BACKTRACE_SELF_TEST=y
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set
CONFIG_HAVE_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_TRACER_MAX_TRACE=y
CONFIG_TRACING=y
# CONFIG_FTRACE is not set
CONFIG_IRQSOFF_TRACER=y
# CONFIG_SYSPROF_TRACER is not set
# CONFIG_SCHED_TRACER is not set
# CONFIG_CONTEXT_SWITCH_TRACER is not set
# CONFIG_FTRACE_STARTUP_TEST is not set
CONFIG_SAMPLES=y
CONFIG_SAMPLE_KOBJECT=y
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_KGDB=y
CONFIG_KGDB_SERIAL_CONSOLE=y
# CONFIG_KGDB_TESTS is not set
CONFIG_NONPROMISC_DEVMEM=y
# CONFIG_EARLY_PRINTK is not set
# CONFIG_DEBUG_STACKOVERFLOW is not set
CONFIG_DEBUG_STACK_USAGE=y
CONFIG_DEBUG_PAGEALLOC=y
CONFIG_DEBUG_PER_CPU_MAPS=y
# CONFIG_X86_PTDUMP is not set
# CONFIG_DEBUG_RODATA is not set
CONFIG_4KSTACKS=y
CONFIG_X86_FIND_SMP_CONFIG=y
CONFIG_X86_MPPARSE=y
# CONFIG_DOUBLEFAULT is not set
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
CONFIG_IO_DELAY_TYPE_NONE=3
# CONFIG_IO_DELAY_0X80 is not set
CONFIG_IO_DELAY_0XED=y
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEFAULT_IO_DELAY_TYPE=1
# CONFIG_DEBUG_BOOT_PARAMS is not set
CONFIG_CPA_DEBUG=y

#
# Security options
#
# CONFIG_KEYS is not set
CONFIG_SECURITY=y
CONFIG_SECURITY_NETWORK=y
# CONFIG_SECURITY_CAPABILITIES is not set
CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
# CONFIG_CRYPTO is not set
CONFIG_HAVE_KVM=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
CONFIG_KVM_INTEL=y
# CONFIG_KVM_AMD is not set
# CONFIG_VIRTIO_BALLOON is not set

#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_FIND_NEXT_BIT=y
# CONFIG_CRC_CCITT is not set
CONFIG_CRC16=y
# CONFIG_CRC_ITU_T is not set
CONFIG_CRC32=y
CONFIG_CRC7=y
# CONFIG_LIBCRC32C is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: use add_highpages_with_active_regions for high pages init
  2008-06-14  8:23   ` Ingo Molnar
  2008-06-14  8:50     ` Ingo Molnar
@ 2008-06-14  9:05     ` Yinghai Lu
  2008-06-16  1:20       ` Huang, Ying
  1 sibling, 1 reply; 22+ messages in thread
From: Yinghai Lu @ 2008-06-14  9:05 UTC (permalink / raw)
  To: Ingo Molnar, Huang, Ying
  Cc: H. Peter Anvin, Thomas Gleixner, Andrew Morton,
	linux-kernel@vger.kernel.org

On Sat, Jun 14, 2008 at 1:23 AM, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Yinghai Lu <yhlu.kernel@gmail.com> wrote:
>
>> use early_node_map to init high pages, so can remove page_is_ram and
>> page_is_reserved_early in the big loop with add_one_highpage
>>
>> also remove the page_is_reserved_early that is not needed.
>
> applied to tip/x86/mpparse for testing, thanks.
>
> Andrew: mm/page_alloc.c modification.

Ying Huang,

I removed page_is_reserved_early....it cause init highmem take extra
time on my big box.

please check efi_reserve_early that is calling reserve_early. so need
to make sure "EFI memmap" is reserved in itself...otherwise you may
need to update e820 table by add_memory_region (....,
E820_RESERVED)...

YH

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: cleanup reloated_initrd
  2008-06-14  3:07 ` [PATCH] x86: cleanup reloated_initrd Yinghai Lu
  2008-06-14  8:28   ` Ingo Molnar
@ 2008-06-14 18:41   ` H. Peter Anvin
  2008-06-14 19:27     ` Yinghai Lu
  1 sibling, 1 reply; 22+ messages in thread
From: H. Peter Anvin @ 2008-06-14 18:41 UTC (permalink / raw)
  To: Yinghai Lu; +Cc: Ingo Molnar, Thomas Gleixner, linux-kernel@vger.kernel.org

Yinghai Lu wrote:
> 1. move that before zone_sizes_init ...
> 2. add free_early for one old one, otherwise it will be be reserved again when
>    init highmem.
> 
> Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
> 
> Index: linux-2.6/arch/x86/kernel/setup_32.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/kernel/setup_32.c
> +++ linux-2.6/arch/x86/kernel/setup_32.c
> @@ -585,6 +585,9 @@ static void __init relocate_initrd(void)
>  	printk(KERN_INFO "Copied RAMDISK from %016llx - %016llx to %08llx - %08llx\n",
>  		ramdisk_image, ramdisk_image + ramdisk_size - 1,
>  		ramdisk_here, ramdisk_here + ramdisk_size - 1);
> +
> +	/* need to free that, otherwise init highmem will reserve it again */
> +	free_early(ramdisk_image, ramdisk_image+ramdisk_size);
>  }
>  

I'm somewhat confused by this... you realize that the old location and 
the new location of the initrd will overlap, right?

	-hpa

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: cleanup reloated_initrd
  2008-06-14 18:41   ` H. Peter Anvin
@ 2008-06-14 19:27     ` Yinghai Lu
  2008-06-14 19:39       ` H. Peter Anvin
  0 siblings, 1 reply; 22+ messages in thread
From: Yinghai Lu @ 2008-06-14 19:27 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Ingo Molnar, Thomas Gleixner, linux-kernel@vger.kernel.org

On Sat, Jun 14, 2008 at 11:41 AM, H. Peter Anvin <hpa@zytor.com> wrote:
> Yinghai Lu wrote:
>>
>> 1. move that before zone_sizes_init ...
>> 2. add free_early for one old one, otherwise it will be be reserved again
>> when
>>   init highmem.
>>
>> Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
>>
>> Index: linux-2.6/arch/x86/kernel/setup_32.c
>> ===================================================================
>> --- linux-2.6.orig/arch/x86/kernel/setup_32.c
>> +++ linux-2.6/arch/x86/kernel/setup_32.c
>> @@ -585,6 +585,9 @@ static void __init relocate_initrd(void)
>>        printk(KERN_INFO "Copied RAMDISK from %016llx - %016llx to %08llx -
>> %08llx\n",
>>                ramdisk_image, ramdisk_image + ramdisk_size - 1,
>>                ramdisk_here, ramdisk_here + ramdisk_size - 1);
>> +
>> +       /* need to free that, otherwise init highmem will reserve it again
>> */
>> +       free_early(ramdisk_image, ramdisk_image+ramdisk_size);
>>  }
>>
>
> I'm somewhat confused by this... you realize that the old location and the
> new location of the initrd will overlap, right?

Ying Huang add page_is_reserved_early check in
add_one_highpage_init(), so reserve_early high address will be
reserved when in init high. that is not wanted old initrd in high
region we will lose some ram

Also I have produced another patch to make init high to use
early_node_map aka active regions. and will sort it out.

anyway, remove that from early_res is some cleanup.

YH

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: cleanup reloated_initrd
  2008-06-14 19:27     ` Yinghai Lu
@ 2008-06-14 19:39       ` H. Peter Anvin
  2008-06-14 22:08         ` Yinghai Lu
  0 siblings, 1 reply; 22+ messages in thread
From: H. Peter Anvin @ 2008-06-14 19:39 UTC (permalink / raw)
  To: Yinghai Lu; +Cc: Ingo Molnar, Thomas Gleixner, linux-kernel@vger.kernel.org

Yinghai Lu wrote:
  Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
>>>
>>> Index: linux-2.6/arch/x86/kernel/setup_32.c
>>> ===================================================================
>>> --- linux-2.6.orig/arch/x86/kernel/setup_32.c
>>> +++ linux-2.6/arch/x86/kernel/setup_32.c
>>> @@ -585,6 +585,9 @@ static void __init relocate_initrd(void)
>>>        printk(KERN_INFO "Copied RAMDISK from %016llx - %016llx to %08llx -
>>> %08llx\n",
>>>                ramdisk_image, ramdisk_image + ramdisk_size - 1,
>>>                ramdisk_here, ramdisk_here + ramdisk_size - 1);
>>> +
>>> +       /* need to free that, otherwise init highmem will reserve it again
>>> */
>>> +       free_early(ramdisk_image, ramdisk_image+ramdisk_size);
>>>  }
>>>
>> I'm somewhat confused by this... you realize that the old location and the
>> new location of the initrd will overlap, right?
> 
> Ying Huang add page_is_reserved_early check in
> add_one_highpage_init(), so reserve_early high address will be
> reserved when in init high. that is not wanted old initrd in high
> region we will lose some ram
> 

Yes, but I think the above will free part of the active area if the 
areas overlap.

	-hpa

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: cleanup reloated_initrd
  2008-06-14 19:39       ` H. Peter Anvin
@ 2008-06-14 22:08         ` Yinghai Lu
  0 siblings, 0 replies; 22+ messages in thread
From: Yinghai Lu @ 2008-06-14 22:08 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Ingo Molnar, Thomas Gleixner, linux-kernel@vger.kernel.org

On Sat, Jun 14, 2008 at 12:39 PM, H. Peter Anvin <hpa@zytor.com> wrote:
> Yinghai Lu wrote:
>  Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
>>>>
>>>> Index: linux-2.6/arch/x86/kernel/setup_32.c
>>>> ===================================================================
>>>> --- linux-2.6.orig/arch/x86/kernel/setup_32.c
>>>> +++ linux-2.6/arch/x86/kernel/setup_32.c
>>>> @@ -585,6 +585,9 @@ static void __init relocate_initrd(void)
>>>>       printk(KERN_INFO "Copied RAMDISK from %016llx - %016llx to %08llx
>>>> -
>>>> %08llx\n",
>>>>               ramdisk_image, ramdisk_image + ramdisk_size - 1,
>>>>               ramdisk_here, ramdisk_here + ramdisk_size - 1);
>>>> +
>>>> +       /* need to free that, otherwise init highmem will reserve it
>>>> again
>>>> */
>>>> +       free_early(ramdisk_image, ramdisk_image+ramdisk_size);
>>>>  }
>>>>
>>> I'm somewhat confused by this... you realize that the old location and
>>> the
>>> new location of the initrd will overlap, right?
>>
>> Ying Huang add page_is_reserved_early check in
>> add_one_highpage_init(), so reserve_early high address will be
>> reserved when in init high. that is not wanted old initrd in high
>> region we will lose some ram
>>
>
> Yes, but I think the above will free part of the active area if the areas
> overlap.

overlap parts below max_low_pfn is freed with free_bootmem

and free_early only remove that entry in early_res array. and at that
time, we already called
early_res_to_bootmem.

so it is safe.

YH

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH] x86: use add_highpages_with_active_regions for high pages init v2
  2008-06-14  7:56 ` [PATCH] x86: use add_highpages_with_active_regions for high pages init Yinghai Lu
  2008-06-14  8:23   ` Ingo Molnar
@ 2008-06-15  1:32   ` Yinghai Lu
  2008-06-16  8:09     ` Ingo Molnar
  1 sibling, 1 reply; 22+ messages in thread
From: Yinghai Lu @ 2008-06-15  1:32 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, Andrew Morton,
	Ying Huang
  Cc: linux-kernel@vger.kernel.org


use early_node_map to init high pages, so can remove page_is_ram and
page_is_reserved_early in the big loop with add_one_highpage

also remove the page_is_reserved_early that is not needed.

v2: fix other platform compiling

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

Index: linux-2.6/arch/x86/kernel/e820.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/e820.c
+++ linux-2.6/arch/x86/kernel/e820.c
@@ -612,17 +612,6 @@ void __init free_early(u64 start, u64 en
 	early_res[j - 1].end = 0;
 }
 
-int __init page_is_reserved_early(unsigned long pagenr)
-{
-	u64 start = (u64)pagenr << PAGE_SHIFT;
-	int i;
-	struct early_res *r;
-
-	i = find_overlapped_early(start, start + PAGE_SIZE);
-	r = &early_res[i];
-	return (i < MAX_EARLY_RES && r->end);
-}
-
 void __init early_res_to_bootmem(u64 start, u64 end)
 {
 	int i;
Index: linux-2.6/arch/x86/mm/discontig_32.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/discontig_32.c
+++ linux-2.6/arch/x86/mm/discontig_32.c
@@ -100,7 +100,6 @@ unsigned long node_memmap_size_bytes(int
 #endif
 
 extern unsigned long find_max_low_pfn(void);
-extern void add_one_highpage_init(struct page *, int, int);
 extern unsigned long highend_pfn, highstart_pfn;
 
 #define LARGE_PAGE_BYTES (PTRS_PER_PTE * PAGE_SIZE)
@@ -410,10 +409,10 @@ void __init set_highmem_pages_init(int b
 {
 #ifdef CONFIG_HIGHMEM
 	struct zone *zone;
-	struct page *page;
+	int nid;
 
 	for_each_zone(zone) {
-		unsigned long node_pfn, zone_start_pfn, zone_end_pfn;
+		unsigned long zone_start_pfn, zone_end_pfn;
 
 		if (!is_highmem(zone))
 			continue;
@@ -421,16 +420,12 @@ void __init set_highmem_pages_init(int b
 		zone_start_pfn = zone->zone_start_pfn;
 		zone_end_pfn = zone_start_pfn + zone->spanned_pages;
 
+		nid = zone_to_nid(zone);
 		printk("Initializing %s for node %d (%08lx:%08lx)\n",
-				zone->name, zone_to_nid(zone),
-				zone_start_pfn, zone_end_pfn);
+				zone->name, nid, zone_start_pfn, zone_end_pfn);
 
-		for (node_pfn = zone_start_pfn; node_pfn < zone_end_pfn; node_pfn++) {
-			if (!pfn_valid(node_pfn))
-				continue;
-			page = pfn_to_page(node_pfn);
-			add_one_highpage_init(page, node_pfn, bad_ppro);
-		}
+		add_highpages_with_active_regions(nid, zone_start_pfn,
+				 zone_end_pfn, bad_ppro);
 	}
 	totalram_pages += totalhigh_pages;
 #endif
Index: linux-2.6/arch/x86/mm/init_32.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/init_32.c
+++ linux-2.6/arch/x86/mm/init_32.c
@@ -292,10 +292,10 @@ static void __init permanent_kmaps_init(
 	pkmap_page_table = pte;
 }
 
-void __init add_one_highpage_init(struct page *page, int pfn, int bad_ppro)
+static void __init
+add_one_highpage_init(struct page *page, int pfn, int bad_ppro)
 {
-	if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn)) &&
-	    !page_is_reserved_early(pfn)) {
+	if (!(bad_ppro && page_kills_ppro(pfn))) {
 		ClearPageReserved(page);
 		init_page_count(page);
 		__free_page(page);
@@ -304,18 +304,58 @@ void __init add_one_highpage_init(struct
 		SetPageReserved(page);
 }
 
+struct add_highpages_data {
+	unsigned long start_pfn;
+	unsigned long end_pfn;
+	int bad_ppro;
+};
+
+static void __init add_highpages_work_fn(unsigned long start_pfn,
+					 unsigned long end_pfn, void *datax)
+{
+	int node_pfn;
+	struct page *page;
+	unsigned long final_start_pfn, final_end_pfn;
+	struct add_highpages_data *data;
+	int bad_ppro;
+
+	data = (struct add_highpages_data *)datax;
+	bad_ppro = data->bad_ppro;
+
+	final_start_pfn = max(start_pfn, data->start_pfn);
+	final_end_pfn = min(end_pfn, data->end_pfn);
+	if (final_start_pfn >= final_end_pfn)
+		return;
+
+	for (node_pfn = final_start_pfn; node_pfn < final_end_pfn;
+	     node_pfn++) {
+		if (!pfn_valid(node_pfn))
+			continue;
+		page = pfn_to_page(node_pfn);
+		add_one_highpage_init(page, node_pfn, bad_ppro);
+	}
+
+}
+
+void __init add_highpages_with_active_regions(int nid, unsigned long start_pfn,
+					      unsigned long end_pfn,
+					      int bad_ppro)
+{
+	struct add_highpages_data data;
+
+	data.start_pfn = start_pfn;
+	data.end_pfn = end_pfn;
+	data.bad_ppro = bad_ppro;
+
+	work_with_active_regions(nid, add_highpages_work_fn, &data);
+}
+
 #ifndef CONFIG_NUMA
 static void __init set_highmem_pages_init(int bad_ppro)
 {
-	int pfn;
+	add_highpages_with_active_regions(0, highstart_pfn, highend_pfn,
+						bad_ppro);
 
-	for (pfn = highstart_pfn; pfn < highend_pfn; pfn++) {
-		/*
-		 * Holes under sparsemem might not have no mem_map[]:
-		 */
-		if (pfn_valid(pfn))
-			add_one_highpage_init(pfn_to_page(pfn), pfn, bad_ppro);
-	}
 	totalram_pages += totalhigh_pages;
 }
 #endif /* !CONFIG_NUMA */
Index: linux-2.6/include/asm-x86/e820.h
===================================================================
--- linux-2.6.orig/include/asm-x86/e820.h
+++ linux-2.6/include/asm-x86/e820.h
@@ -86,7 +86,6 @@ extern u64 find_e820_area_size(u64 start
 extern void reserve_early(u64 start, u64 end, char *name);
 extern void free_early(u64 start, u64 end);
 extern void early_res_to_bootmem(u64 start, u64 end);
-extern int page_is_reserved_early(unsigned long pagenr);
 extern u64 early_reserve_e820(u64 startt, u64 sizet, u64 align);
 
 extern unsigned long e820_end_of_ram(void);
Index: linux-2.6/include/asm-x86/highmem.h
===================================================================
--- linux-2.6.orig/include/asm-x86/highmem.h
+++ linux-2.6/include/asm-x86/highmem.h
@@ -74,6 +74,9 @@ struct page *kmap_atomic_to_page(void *p
 
 #define flush_cache_kmaps()	do { } while (0)
 
+extern void add_highpages_with_active_regions(int nid, unsigned long start_pfn,
+					unsigned long end_pfn, int bad_ppro);
+
 #endif /* __KERNEL__ */
 
 #endif /* _ASM_HIGHMEM_H */
Index: linux-2.6/include/linux/mm.h
===================================================================
--- linux-2.6.orig/include/linux/mm.h
+++ linux-2.6/include/linux/mm.h
@@ -1011,6 +1011,8 @@ extern unsigned long find_min_pfn_with_a
 extern unsigned long find_max_pfn_with_active_regions(void);
 extern void free_bootmem_with_active_regions(int nid,
 						unsigned long max_low_pfn);
+typedef void (*work_fn_t)(unsigned long, unsigned long, void *);
+extern void work_with_active_regions(int nid, work_fn_t work_fn, void *data);
 extern void sparse_memory_present_with_active_regions(int nid);
 #ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
 extern int early_pfn_to_nid(unsigned long pfn);
Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c
+++ linux-2.6/mm/page_alloc.c
@@ -2939,6 +2939,14 @@ void __init free_bootmem_with_active_reg
 	}
 }
 
+void __init work_with_active_regions(int nid, work_fn_t work_fn, void *data)
+{
+	int i;
+
+	for_each_active_range_index_in_nid(i, nid)
+		work_fn(early_node_map[i].start_pfn, early_node_map[i].end_pfn,
+			data);
+}
 /**
  * sparse_memory_present_with_active_regions - Call memory_present for each active range
  * @nid: The node to call memory_present for. If MAX_NUMNODES, all nodes will be used.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: use add_highpages_with_active_regions for high pages init
  2008-06-14  9:05     ` Yinghai Lu
@ 2008-06-16  1:20       ` Huang, Ying
  2008-06-16  3:46         ` Yinghai Lu
  0 siblings, 1 reply; 22+ messages in thread
From: Huang, Ying @ 2008-06-16  1:20 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, Andrew Morton,
	linux-kernel@vger.kernel.org

On Sat, 2008-06-14 at 02:05 -0700, Yinghai Lu wrote:
> On Sat, Jun 14, 2008 at 1:23 AM, Ingo Molnar <mingo@elte.hu> wrote:
> >
> > * Yinghai Lu <yhlu.kernel@gmail.com> wrote:
> >
> >> use early_node_map to init high pages, so can remove page_is_ram and
> >> page_is_reserved_early in the big loop with add_one_highpage
> >>
> >> also remove the page_is_reserved_early that is not needed.
> >
> > applied to tip/x86/mpparse for testing, thanks.
> >
> > Andrew: mm/page_alloc.c modification.
> 
> Ying Huang,
> 
> I removed page_is_reserved_early....it cause init highmem take extra
> time on my big box.

OK.

> please check efi_reserve_early that is calling reserve_early. so need
> to make sure "EFI memmap" is reserved in itself...otherwise you may
> need to update e820 table by add_memory_region (....,
> E820_RESERVED)...

EFI memmap may be in highmem, it can not be reserved by bootmem
allocator on i386. So I think it is necessary to have an early highmem
allocator. It can be used for EFI memory map and linked list of setup
data which comes from boot-loader and may be located in highmem.

As for the implementation, what about adding a remove_active_range()
which operate on early_node_map and an early_res_to_early_node_map()?

Best Regards,
Huang Ying


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: use add_highpages_with_active_regions for high pages init
  2008-06-16  1:20       ` Huang, Ying
@ 2008-06-16  3:46         ` Yinghai Lu
  2008-06-16  4:39           ` Yinghai Lu
  2008-06-16  5:37           ` Huang, Ying
  0 siblings, 2 replies; 22+ messages in thread
From: Yinghai Lu @ 2008-06-16  3:46 UTC (permalink / raw)
  To: Huang, Ying
  Cc: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, Andrew Morton,
	linux-kernel@vger.kernel.org

On Sun, Jun 15, 2008 at 6:20 PM, Huang, Ying <ying.huang@intel.com> wrote:
> On Sat, 2008-06-14 at 02:05 -0700, Yinghai Lu wrote:
>> On Sat, Jun 14, 2008 at 1:23 AM, Ingo Molnar <mingo@elte.hu> wrote:
>> >
>> > * Yinghai Lu <yhlu.kernel@gmail.com> wrote:
>> >
>> >> use early_node_map to init high pages, so can remove page_is_ram and
>> >> page_is_reserved_early in the big loop with add_one_highpage
>> >>
>> >> also remove the page_is_reserved_early that is not needed.
>> >
>> > applied to tip/x86/mpparse for testing, thanks.
>> >
>> > Andrew: mm/page_alloc.c modification.
>>
>> Ying Huang,
>>
>> I removed page_is_reserved_early....it cause init highmem take extra
>> time on my big box.
>
> OK.
>
>> please check efi_reserve_early that is calling reserve_early. so need
>> to make sure "EFI memmap" is reserved in itself...otherwise you may
>> need to update e820 table by add_memory_region (....,
>> E820_RESERVED)...
>
> EFI memmap may be in highmem, it can not be reserved by bootmem
> allocator on i386. So I think it is necessary to have an early highmem
> allocator. It can be used for EFI memory map and linked list of setup
> data which comes from boot-loader and may be located in highmem.
>
> As for the implementation, what about adding a remove_active_range()
> which operate on early_node_map and an early_res_to_early_node_map()?

don't need,
EFI memmap should be reserved in e820map, so it should not show up in
early_node_map.
if it is not reserved in e820map, you could use e820_add_region or
e820_update_range make it reserved

YH

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: use add_highpages_with_active_regions for high pages init
  2008-06-16  3:46         ` Yinghai Lu
@ 2008-06-16  4:39           ` Yinghai Lu
  2008-06-16  5:37           ` Huang, Ying
  1 sibling, 0 replies; 22+ messages in thread
From: Yinghai Lu @ 2008-06-16  4:39 UTC (permalink / raw)
  To: Huang, Ying
  Cc: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, Andrew Morton,
	linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 1709 bytes --]

On Sun, Jun 15, 2008 at 8:46 PM, Yinghai Lu <yhlu.kernel@gmail.com> wrote:
> On Sun, Jun 15, 2008 at 6:20 PM, Huang, Ying <ying.huang@intel.com> wrote:
>> On Sat, 2008-06-14 at 02:05 -0700, Yinghai Lu wrote:
>>> On Sat, Jun 14, 2008 at 1:23 AM, Ingo Molnar <mingo@elte.hu> wrote:
>>> >
>>> > * Yinghai Lu <yhlu.kernel@gmail.com> wrote:
>>> >
>>> >> use early_node_map to init high pages, so can remove page_is_ram and
>>> >> page_is_reserved_early in the big loop with add_one_highpage
>>> >>
>>> >> also remove the page_is_reserved_early that is not needed.
>>> >
>>> > applied to tip/x86/mpparse for testing, thanks.
>>> >
>>> > Andrew: mm/page_alloc.c modification.
>>>
>>> Ying Huang,
>>>
>>> I removed page_is_reserved_early....it cause init highmem take extra
>>> time on my big box.
>>
>> OK.
>>
>>> please check efi_reserve_early that is calling reserve_early. so need
>>> to make sure "EFI memmap" is reserved in itself...otherwise you may
>>> need to update e820 table by add_memory_region (....,
>>> E820_RESERVED)...
>>
>> EFI memmap may be in highmem, it can not be reserved by bootmem
>> allocator on i386. So I think it is necessary to have an early highmem
>> allocator. It can be used for EFI memory map and linked list of setup
>> data which comes from boot-loader and may be located in highmem.
>>
>> As for the implementation, what about adding a remove_active_range()
>> which operate on early_node_map and an early_res_to_early_node_map()?
>
> don't need,
> EFI memmap should be reserved in e820map, so it should not show up in
> early_node_map.
> if it is not reserved in e820map, you could use e820_add_region or
> e820_update_range make it reserved

something like attached patch

YH

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: efi_memmap.patch --]
[-- Type: text/x-patch; name=efi_memmap.patch, Size: 1136 bytes --]

[PATCH] x86: reserve efi map itself in e820 map

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c
index d5c7fcd..f0869bb 100644
--- a/arch/x86/kernel/efi.c
+++ b/arch/x86/kernel/efi.c
@@ -235,6 +235,8 @@ static void __init add_efi_memmap(void)
 			e820_type = E820_RESERVED;
 		e820_add_region(start, size, e820_type);
 	}
+	e820_add_region(memmap.phys_map, memmap.nr_map * memmap.desc_size,
+			E820_RESERVED);
 	sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
 }
 
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index de2645e..5fa241e 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -370,6 +370,9 @@ void __init setup_arch(char **cmdline_p)
 
 	early_gart_iommu_check();
 
+	if (efi_enabled)
+		efi_init();
+
 	e820_register_active_regions(0, 0, -1UL);
 	/*
 	 * partially used pages are not usable - thus
@@ -392,8 +395,6 @@ void __init setup_arch(char **cmdline_p)
 	check_efer();
 
 	max_pfn_mapped = init_memory_mapping(0, (end_pfn << PAGE_SHIFT));
-	if (efi_enabled)
-		efi_init();
 
 	vsmp_init();
 

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: use add_highpages_with_active_regions for high pages init
  2008-06-16  3:46         ` Yinghai Lu
  2008-06-16  4:39           ` Yinghai Lu
@ 2008-06-16  5:37           ` Huang, Ying
  2008-06-16  5:38             ` H. Peter Anvin
  1 sibling, 1 reply; 22+ messages in thread
From: Huang, Ying @ 2008-06-16  5:37 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, Andrew Morton,
	linux-kernel@vger.kernel.org

On Sun, 2008-06-15 at 20:46 -0700, Yinghai Lu wrote:
[...]
> don't need,
> EFI memmap should be reserved in e820map, so it should not show up in
> early_node_map.

I don't think so. EFI memmap comes from boot-loader not from BIOS. It
contains boot-loader execution information (such as EfiLoaderCode,
EfiLoaderData, etc), and it will be located at different position for
each system reboot.

If it is reserved in E820 memmap, hibernation can not work. Because the
memory area for EFI memmap is not E820 RAM, it is not saved during
hibernating and restored after restoring from disk.

Linked list of struct setup_data has similar requirement too.

Best Regards,
Huang Ying


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: use add_highpages_with_active_regions for high pages init
  2008-06-16  5:37           ` Huang, Ying
@ 2008-06-16  5:38             ` H. Peter Anvin
  2008-06-16  5:43               ` Yinghai Lu
  2008-06-16  5:45               ` Huang, Ying
  0 siblings, 2 replies; 22+ messages in thread
From: H. Peter Anvin @ 2008-06-16  5:38 UTC (permalink / raw)
  To: Huang, Ying
  Cc: Yinghai Lu, Ingo Molnar, Thomas Gleixner, Andrew Morton,
	linux-kernel@vger.kernel.org

Huang, Ying wrote:
> On Sun, 2008-06-15 at 20:46 -0700, Yinghai Lu wrote:
> [...]
>> don't need,
>> EFI memmap should be reserved in e820map, so it should not show up in
>> early_node_map.
> 
> I don't think so. EFI memmap comes from boot-loader not from BIOS. It
> contains boot-loader execution information (such as EfiLoaderCode,
> EfiLoaderData, etc), and it will be located at different position for
> each system reboot.
> 
> If it is reserved in E820 memmap, hibernation can not work. Because the
> memory area for EFI memmap is not E820 RAM, it is not saved during
> hibernating and restored after restoring from disk.
> 
> Linked list of struct setup_data has similar requirement too.
> 

That doesn't mean we can't use the E820 memory map structure for it.  We 
just have to define a new kernel-internal memory type, instead of using 
type 2 (reserved).

	-hpa

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: use add_highpages_with_active_regions for high pages init
  2008-06-16  5:38             ` H. Peter Anvin
@ 2008-06-16  5:43               ` Yinghai Lu
  2008-06-16  5:45               ` Huang, Ying
  1 sibling, 0 replies; 22+ messages in thread
From: Yinghai Lu @ 2008-06-16  5:43 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Huang, Ying, Ingo Molnar, Thomas Gleixner, Andrew Morton,
	linux-kernel@vger.kernel.org

On Sun, Jun 15, 2008 at 10:38 PM, H. Peter Anvin <hpa@zytor.com> wrote:
> Huang, Ying wrote:
>>
>> On Sun, 2008-06-15 at 20:46 -0700, Yinghai Lu wrote:
>> [...]
>>>
>>> don't need,
>>> EFI memmap should be reserved in e820map, so it should not show up in
>>> early_node_map.
>>
>> I don't think so. EFI memmap comes from boot-loader not from BIOS. It
>> contains boot-loader execution information (such as EfiLoaderCode,
>> EfiLoaderData, etc), and it will be located at different position for
>> each system reboot.
>>
>> If it is reserved in E820 memmap, hibernation can not work. Because the
>> memory area for EFI memmap is not E820 RAM, it is not saved during
>> hibernating and restored after restoring from disk.
>>
>> Linked list of struct setup_data has similar requirement too.
>>
>
> That doesn't mean we can't use the E820 memory map structure for it.  We
> just have to define a new kernel-internal memory type, instead of using type
> 2 (reserved).

yes. then just modify e820_mark_nosave_regions a little bit.

YH

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: use add_highpages_with_active_regions for high pages init
  2008-06-16  5:38             ` H. Peter Anvin
  2008-06-16  5:43               ` Yinghai Lu
@ 2008-06-16  5:45               ` Huang, Ying
  1 sibling, 0 replies; 22+ messages in thread
From: Huang, Ying @ 2008-06-16  5:45 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Yinghai Lu, Ingo Molnar, Thomas Gleixner, Andrew Morton,
	linux-kernel@vger.kernel.org

On Sun, 2008-06-15 at 22:38 -0700, H. Peter Anvin wrote:
> Huang, Ying wrote:
> > On Sun, 2008-06-15 at 20:46 -0700, Yinghai Lu wrote:
> > [...]
> >> don't need,
> >> EFI memmap should be reserved in e820map, so it should not show up in
> >> early_node_map.
> > 
> > I don't think so. EFI memmap comes from boot-loader not from BIOS. It
> > contains boot-loader execution information (such as EfiLoaderCode,
> > EfiLoaderData, etc), and it will be located at different position for
> > each system reboot.
> > 
> > If it is reserved in E820 memmap, hibernation can not work. Because the
> > memory area for EFI memmap is not E820 RAM, it is not saved during
> > hibernating and restored after restoring from disk.
> > 
> > Linked list of struct setup_data has similar requirement too.
> > 
> 
> That doesn't mean we can't use the E820 memory map structure for it.  We 
> just have to define a new kernel-internal memory type, instead of using 
> type 2 (reserved).

Yes. I will do this.

Best Regards,
Huang Ying


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] x86: use add_highpages_with_active_regions for high pages init v2
  2008-06-15  1:32   ` [PATCH] x86: use add_highpages_with_active_regions for high pages init v2 Yinghai Lu
@ 2008-06-16  8:09     ` Ingo Molnar
  0 siblings, 0 replies; 22+ messages in thread
From: Ingo Molnar @ 2008-06-16  8:09 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: H. Peter Anvin, Thomas Gleixner, Andrew Morton, Ying Huang,
	linux-kernel@vger.kernel.org


* Yinghai Lu <yhlu.kernel@gmail.com> wrote:

> use early_node_map to init high pages, so can remove page_is_ram and 
> page_is_reserved_early in the big loop with add_one_highpage
> 
> also remove the page_is_reserved_early that is not needed.
> 
> v2: fix other platform compiling

applied to tip/x86/mpparse, thanks.

	Ingo

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2008-06-16  8:10 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-14  3:05 [PATCH] x86: replace shrink pages with remove_active_ranges v2 Yinghai Lu
2008-06-14  3:07 ` [PATCH] x86: cleanup reloated_initrd Yinghai Lu
2008-06-14  8:28   ` Ingo Molnar
2008-06-14 18:41   ` H. Peter Anvin
2008-06-14 19:27     ` Yinghai Lu
2008-06-14 19:39       ` H. Peter Anvin
2008-06-14 22:08         ` Yinghai Lu
2008-06-14  6:23 ` [PATCH] x86: replace shrink pages with remove_active_ranges v2 Ingo Molnar
2008-06-14  7:56 ` [PATCH] x86: use add_highpages_with_active_regions for high pages init Yinghai Lu
2008-06-14  8:23   ` Ingo Molnar
2008-06-14  8:50     ` Ingo Molnar
2008-06-14  8:59       ` Ingo Molnar
2008-06-14  9:05     ` Yinghai Lu
2008-06-16  1:20       ` Huang, Ying
2008-06-16  3:46         ` Yinghai Lu
2008-06-16  4:39           ` Yinghai Lu
2008-06-16  5:37           ` Huang, Ying
2008-06-16  5:38             ` H. Peter Anvin
2008-06-16  5:43               ` Yinghai Lu
2008-06-16  5:45               ` Huang, Ying
2008-06-15  1:32   ` [PATCH] x86: use add_highpages_with_active_regions for high pages init v2 Yinghai Lu
2008-06-16  8:09     ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox