linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC] peeling off zone from physical memory layout [9/10] remove zone_start_pfn from page_alloc.c
@ 2006-02-03  7:54 KAMEZAWA Hiroyuki
  0 siblings, 0 replies; only message in thread
From: KAMEZAWA Hiroyuki @ 2006-02-03  7:54 UTC (permalink / raw)
  To: linux-mm

This patch removes zone_start_pfn, spanned_pages from mm/page_alloc.c.

Signed-Off-By: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>


Index: hogehoge/include/linux/mmzone.h
===================================================================
--- hogehoge.orig/include/linux/mmzone.h
+++ hogehoge/include/linux/mmzone.h
@@ -212,20 +212,7 @@ struct zone {
  	 * Discontig memory support fields.
  	 */
  	struct pglist_data	*zone_pgdat;
-	/* zone_start_pfn == zone_start_paddr >> PAGE_SHIFT */
-	unsigned long		zone_start_pfn;

-	/*
-	 * zone_start_pfn, spanned_pages and present_pages are all
-	 * protected by span_seqlock.  It is a seqlock because it has
-	 * to be read outside of zone->lock, and it is done in the main
-	 * allocator path.  But, it is written quite infrequently.
-	 *
-	 * The lock is declared along with zone->lock because it is
-	 * frequently read in proximity to zone->lock.  It's good to
-	 * give them a chance of being in the same cacheline.
-	 */
-	unsigned long		spanned_pages;	/* total size, including holes */
  	unsigned long		present_pages;	/* amount of memory (excluding holes) */

  	/*
Index: hogehoge/mm/page_alloc.c
===================================================================
--- hogehoge.orig/mm/page_alloc.c
+++ hogehoge/mm/page_alloc.c
@@ -89,19 +89,7 @@ unsigned long __initdata nr_all_pages;
  #ifdef CONFIG_DEBUG_VM
  static int page_outside_zone_boundaries(struct zone *zone, struct page *page)
  {
-	int ret = 0;
-	unsigned seq;
-	unsigned long pfn = page_to_pfn(page);
-
-	do {
-		seq = zone_span_seqbegin(zone);
-		if (pfn >= zone->zone_start_pfn + zone->spanned_pages)
-			ret = 1;
-		else if (pfn < zone->zone_start_pfn)
-			ret = 1;
-	} while (zone_span_seqretry(zone, seq));
-
-	return ret;
+	return page_zone(page) != zone;
  }

  static int page_is_consistent(struct zone *zone, struct page *page)
@@ -649,7 +637,7 @@ void mark_free_pages(struct zone *zone)
  	int order;
  	struct list_head *curr;

-	if (!zone->spanned_pages)
+	if (!populated_zone(zone))
  		return;

  	spin_lock_irqsave(&zone->lock, flags);
@@ -2012,11 +2000,9 @@ static __meminit void init_currently_emp
  	zone_wait_table_init(zone, size);
  	pgdat->nr_zones = zone_idx(zone) + 1;

-	zone->zone_start_pfn = zone_start_pfn;
-
  	memmap_init(size, pgdat->node_id, zone_idx(zone), zone_start_pfn);

-	zone_init_free_lists(pgdat, zone, zone->spanned_pages);
+	zone_init_free_lists(pgdat, zone, size);
  	arch_register_memory_zone(zone, zone_start_pfn, size);
  }

@@ -2052,7 +2038,6 @@ static void __init free_area_init_core(s
  			nr_kernel_pages += realsize;
  		nr_all_pages += realsize;

-		zone->spanned_pages = size;
  		zone->present_pages = realsize;
  		zone->name = zone_names[j];
  		spin_lock_init(&zone->lock);
@@ -2219,7 +2204,6 @@ static int zoneinfo_show(struct seq_file
  			   "\n        active   %lu"
  			   "\n        inactive %lu"
  			   "\n        scanned  %lu (a: %lu i: %lu)"
-			   "\n        spanned  %lu"
  			   "\n        present  %lu",
  			   zone->free_pages,
  			   zone->pages_min,
@@ -2229,7 +2213,6 @@ static int zoneinfo_show(struct seq_file
  			   zone->nr_inactive,
  			   zone->pages_scanned,
  			   zone->nr_scan_active, zone->nr_scan_inactive,
-			   zone->spanned_pages,
  			   zone->present_pages);
  		seq_printf(m,
  			   "\n        protection: (%lu",
@@ -2280,12 +2263,10 @@ static int zoneinfo_show(struct seq_file
  		seq_printf(m,
  			   "\n  all_unreclaimable: %u"
  			   "\n  prev_priority:     %i"
-			   "\n  temp_priority:     %i"
-			   "\n  start_pfn:         %lu",
+			   "\n  temp_priority:     %i",
  			   zone->all_unreclaimable,
  			   zone->prev_priority,
-			   zone->temp_priority,
-			   zone->zone_start_pfn);
+			   zone->temp_priority);
  		spin_unlock_irqrestore(&zone->lock, flags);
  		seq_putc(m, '\n');
  	}

--
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>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-02-03  7:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-03  7:54 [RFC] peeling off zone from physical memory layout [9/10] remove zone_start_pfn from page_alloc.c KAMEZAWA Hiroyuki

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