All of lore.kernel.org
 help / color / mirror / Atom feed
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: linux-mm <linux-mm@kvack.org>
Subject: [RFC] peeling off zone from physical memory layout [9/10] remove zone_start_pfn from page_alloc.c
Date: Fri, 03 Feb 2006 16:54:49 +0900	[thread overview]
Message-ID: <43E30C49.5030302@jp.fujitsu.com> (raw)

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>

                 reply	other threads:[~2006-02-03  7:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=43E30C49.5030302@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is 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.