linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ankita Garg <ankita@in.ibm.com>
To: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	linux-pm@lists.linux-foundation.org
Cc: ankita@in.ibm.com, svaidy@linux.vnet.ibm.com, thomas.abraham@linaro.org
Subject: [PATCH 09/10] mm: Reflect memory region changes in zoneinfo
Date: Fri, 27 May 2011 18:01:37 +0530	[thread overview]
Message-ID: <1306499498-14263-10-git-send-email-ankita@in.ibm.com> (raw)
In-Reply-To: <1306499498-14263-1-git-send-email-ankita@in.ibm.com>

This patch modifies the output of /proc/zoneinfo to take the memory regions
into into account. Below is the output on the Samsung board booted with 4
regions, each of size 512MB.

# cat /proc/zoneinfo
Node 0, Region 0, zone   Normal
  pages free     124570
        min      388
        low      485
        high     582
        scanned  0
        spanned  131072
        present  130048
    nr_free_pages 124570
    nr_inactive_anon 0
    nr_active_anon 92
    nr_inactive_file 454
    nr_active_file 190
    nr_unevictable 0
    nr_mlock     0
    nr_anon_pages 95
    nr_mapped    290
    nr_file_pages 647
    nr_dirty     1
    nr_writeback 0
    nr_slab_reclaimable 33
    nr_slab_unreclaimable 428
    nr_page_table_pages 4
    nr_kernel_stack 20
    nr_unstable  0
    nr_bounce    0
    nr_vmscan_write 0
    nr_writeback_temp 0
    nr_isolated_anon 0
    nr_isolated_file 0
    nr_shmem     0
    nr_dirtied   12
    nr_written   11
    nr_anon_transparent_hugepages 0
        protection: (0, 0)
  pagesets
    cpu: 0
              count: 48
              high:  186
              batch: 31
  vm stats threshold: 6
  all_unreclaimable: 0
  start_pfn:         262144
  inactive_ratio:    1
Node 0, Region 1, zone   Normal
  pages free     131072
        min      388
        low      485
        high     582
        scanned  0
        spanned  131072
        present  130048
    nr_free_pages 131072
.....
Node 0, Region 2, zone   Normal
  pages free     131072
        min      388
        low      485
        high     582
        scanned  0
        spanned  131072
        present  130048
    nr_free_pages 131072
.....
Node 0, Region 3, zone   Normal
  pages free     57332
        min      170
        low      212
        high     255
        scanned  0
        spanned  57344
        present  56896
    nr_free_pages 57332
.....

Signed-off-by: Ankita Garg <ankita@in.ibm.com>
---
 mm/vmstat.c |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/mm/vmstat.c b/mm/vmstat.c
index 542f8b6..153e25b 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -179,16 +179,18 @@ static void refresh_zone_stat_thresholds(void)
 		 */
 		tolerate_drift = low_wmark_pages(zone) - min_wmark_pages(zone);
 		max_drift = num_online_cpus() * threshold;
-		if (max_drift > tolerate_drift)
+		if (max_drift > tolerate_drift) {
 			zone->percpu_drift_mark = high_wmark_pages(zone) +
 					max_drift;
+			printk("zone %s drift mark %lu \n", zone->name, 
+						zone->percpu_drift_mark);
+		}
 	}
 }
 
 void set_pgdat_percpu_threshold(pg_data_t *pgdat,
 				int (*calculate_pressure)(struct zone *))
 {
-	struct zone *zone;
 	int cpu;
 	int threshold;
 	int i, p;
@@ -669,11 +671,12 @@ static void walk_zones_in_node(struct seq_file *m, pg_data_t *pgdat,
 
 #ifdef CONFIG_PROC_FS
 static void frag_show_print(struct seq_file *m, pg_data_t *pgdat,
-						struct zone *zone)
+					mem_region_t *mem_region, struct zone *zone)
 {
 	int order;
 
-	seq_printf(m, "Node %d, zone %8s ", pgdat->node_id, zone->name);
+	seq_printf(m, "Node %d, REG %d, zone %8s ", pgdat->node_id,
+						mem_region->region, zone->name);
 	for (order = 0; order < MAX_ORDER; ++order)
 		seq_printf(m, "%6lu ", zone->free_area[order].nr_free);
 	seq_putc(m, '\n');
@@ -689,14 +692,15 @@ static int frag_show(struct seq_file *m, void *arg)
 	return 0;
 }
 
-static void pagetypeinfo_showfree_print(struct seq_file *m,
-					pg_data_t *pgdat, struct zone *zone)
+static void pagetypeinfo_showfree_print(struct seq_file *m, pg_data_t *pgdat,
+						mem_region_t *mem_region, struct zone *zone)
 {
 	int order, mtype;
 
 	for (mtype = 0; mtype < MIGRATE_TYPES; mtype++) {
-		seq_printf(m, "Node %4d, zone %8s, type %12s ",
+		seq_printf(m, "Node %4d, Region %d, zone %8s, type %12s ",
 					pgdat->node_id,
+					mem_region->region,
 					zone->name,
 					migratetype_names[mtype]);
 		for (order = 0; order < MAX_ORDER; ++order) {
@@ -731,8 +735,8 @@ static int pagetypeinfo_showfree(struct seq_file *m, void *arg)
 	return 0;
 }
 
-static void pagetypeinfo_showblockcount_print(struct seq_file *m,
-					pg_data_t *pgdat, struct zone *zone)
+static void pagetypeinfo_showblockcount_print(struct seq_file *m, pg_data_t *pgdat,
+							mem_region_t *mem_region, struct zone *zone)
 {
 	int mtype;
 	unsigned long pfn;
@@ -759,7 +763,7 @@ static void pagetypeinfo_showblockcount_print(struct seq_file *m,
 	}
 
 	/* Print counts */
-	seq_printf(m, "Node %d, zone %8s ", pgdat->node_id, zone->name);
+	seq_printf(m, "Node %d, Region %d, zone %8s ", pgdat->node_id, mem_region->region, zone->name);
 	for (mtype = 0; mtype < MIGRATE_TYPES; mtype++)
 		seq_printf(m, "%12lu ", count[mtype]);
 	seq_putc(m, '\n');
@@ -969,10 +973,11 @@ static const char * const vmstat_text[] = {
 };
 
 static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat,
-							struct zone *zone)
+					mem_region_t *mem_region, struct zone *zone)
 {
 	int i;
-	seq_printf(m, "Node %d, zone %8s", pgdat->node_id, zone->name);
+	seq_printf(m, "Node %d, Region %d, zone %8s", pgdat->node_id,
+						mem_region->region, zone->name);
 	seq_printf(m,
 		   "\n  pages free     %lu"
 		   "\n        min      %lu"
-- 
1.7.4

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2011-05-27 12:32 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-27 12:31 [PATCH 00/10] mm: Linux VM Infrastructure to support Memory Power Management Ankita Garg
2011-05-27 12:31 ` [PATCH 01/10] mm: Introduce the memory regions data structure Ankita Garg
2011-05-27 15:30   ` Dave Hansen
2011-05-27 18:20     ` Vaidyanathan Srinivasan
2011-05-27 21:31       ` Dave Hansen
2011-05-29  8:16         ` Ankita Garg
2011-05-31 17:34           ` Dave Hansen
2011-06-02  8:54             ` Ankita Garg
2011-05-27 12:31 ` [PATCH 02/10] mm: Helper routines Ankita Garg
2011-05-27 12:31 ` [PATCH 03/10] mm: Init zones inside memory regions Ankita Garg
2011-05-27 12:31 ` [PATCH 04/10] mm: Refer to zones from " Ankita Garg
2011-05-27 12:31 ` [PATCH 05/10] mm: Create zonelists Ankita Garg
2011-05-27 12:31 ` [PATCH 06/10] mm: Verify zonelists Ankita Garg
2011-05-27 12:31 ` [PATCH 07/10] mm: Modify vmstat Ankita Garg
2011-05-27 12:31 ` [PATCH 08/10] mm: Modify vmscan Ankita Garg
2011-05-27 12:31 ` Ankita Garg [this message]
2011-05-27 12:31 ` [PATCH 10/10] mm: Create memory regions at boot-up Ankita Garg
2011-05-28 14:39   ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-28  7:56 ` [PATCH 00/10] mm: Linux VM Infrastructure to support Memory Power Management Andrew Morton
2011-05-28 13:16   ` Ankita Garg
2011-06-09 18:52   ` Paul E. McKenney
2011-06-10  0:51     ` Kyungmin Park
2011-06-10 15:11       ` Paul E. McKenney
2011-06-10 15:59         ` Matthew Garrett
2011-06-10 16:55           ` Paul E. McKenney
2011-06-10 17:05             ` Matthew Garrett
2011-06-10 17:19               ` Paul E. McKenney
2011-06-10 17:23                 ` Matthew Garrett
2011-06-10 17:52                   ` Paul E. McKenney
2011-06-10 18:08                     ` Matthew Garrett
2011-06-10 18:47                       ` Paul E. McKenney
2011-06-10 19:23                         ` Matthew Garrett
2011-06-10 19:37                           ` Paul E. McKenney
2011-06-10 20:12                             ` Matthew Garrett
2011-06-11  3:02                             ` Arjan van de Ven
2011-06-11 17:06                               ` Paul E. McKenney
2011-06-11 17:26                                 ` Arjan van de Ven
2011-06-12 23:07                                   ` Paul E. McKenney
2011-06-13 14:28                                     ` Arjan van de Ven
2011-06-13 23:04                                       ` Paul E. McKenney
2011-06-14  8:51                               ` Ankita Garg
2011-06-15 16:53                               ` Ankita Garg
2011-06-18  4:08                                 ` Arjan van de Ven
2011-06-10 17:33                 ` Ankita Garg
2011-06-11 17:08                   ` Paul E. McKenney
2011-07-12  5:31   ` amit kachhap
2011-06-13  4:47 ` KAMEZAWA Hiroyuki
2011-06-16  4:20   ` Ankita Garg
2011-06-16  9:12     ` KAMEZAWA Hiroyuki
2011-06-17 15:28       ` Ankita Garg
2011-06-19 23:53         ` KAMEZAWA Hiroyuki
2011-06-16 16:04     ` Dave Hansen
2011-06-17 10:03       ` Ankita Garg
2011-06-29 13:00 ` Ankita Garg
2011-06-29 17:06   ` Dave Hansen
2011-06-29 17:42     ` Ankita Garg
2011-06-29 17:59       ` Dave Hansen
2011-06-29 18:17         ` Vaidyanathan Srinivasan
2011-06-30  4:37           ` Ankita Garg
2011-06-29 20:11         ` Andi Kleen
2011-06-30  5:11           ` Ankita Garg
2011-06-29 18:07     ` Vaidyanathan Srinivasan
2011-07-06  8:45   ` Pekka Enberg
2011-07-06  9:01     ` Pekka Enberg
2011-07-06 16:50       ` Vaidyanathan Srinivasan
2011-07-06 16:41     ` Vaidyanathan Srinivasan
2011-07-06 20:20     ` david
2011-07-07  4:54       ` Ankita Garg
2011-07-07 18:00       ` Pekka Enberg
2011-07-08  1:32         ` david

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=1306499498-14263-10-git-send-email-ankita@in.ibm.com \
    --to=ankita@in.ibm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=svaidy@linux.vnet.ibm.com \
    --cc=thomas.abraham@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).