From patchwork Fri May 27 12:31:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankita Garg X-Patchwork-Id: 823972 Received: from bombadil.infradead.org (173-166-109-252-newengland.hfc.comcastbusiness.net [173.166.109.252]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4RCjAR9007940 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 27 May 2011 12:45:31 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by bombadil.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QPwEW-0006bh-9w; Fri, 27 May 2011 12:33:48 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QPwEJ-0002QU-Qk; Fri, 27 May 2011 12:33:27 +0000 Received: from e28smtp01.in.ibm.com ([122.248.162.1]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QPwD1-0002Je-EQ for linux-arm-kernel@lists.infradead.org; Fri, 27 May 2011 12:32:15 +0000 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by e28smtp01.in.ibm.com (8.14.4/8.13.1) with ESMTP id p4RCVwu0018245 for ; Fri, 27 May 2011 18:01:58 +0530 Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p4RCVvsU4481178 for ; Fri, 27 May 2011 18:01:57 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p4RCVr9C003703 for ; Fri, 27 May 2011 22:31:54 +1000 Received: from rollercoaster.ibm.com ([9.124.35.203]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p4RCVqo8003574; Fri, 27 May 2011 22:31:53 +1000 From: Ankita Garg To: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-pm@lists.linux-foundation.org Subject: [PATCH 09/10] mm: Reflect memory region changes in zoneinfo Date: Fri, 27 May 2011 18:01:37 +0530 Message-Id: <1306499498-14263-10-git-send-email-ankita@in.ibm.com> X-Mailer: git-send-email 1.7.4 In-Reply-To: <1306499498-14263-1-git-send-email-ankita@in.ibm.com> References: <1306499498-14263-1-git-send-email-ankita@in.ibm.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110527_083208_275508_5A18410C X-CRM114-Status: GOOD ( 14.51 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [122.248.162.1 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: svaidy@linux.vnet.ibm.com, thomas.abraham@linaro.org, ankita@in.ibm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 27 May 2011 12:45:32 +0000 (UTC) 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 --- 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"