public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: linux-kernel@vger.kernel.org
Cc: Martin Bligh <mbligh@google.com>,
	Christoph Hellwig <hch@infradead.org>,
	Marcelo Tosatti <marcelo@kvack.org>,
	Arjan van de Ven <arjan@infradead.org>,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	Christoph Lameter <clameter@sgi.com>, Andi Kleen <ak@suse.de>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: [RFC 3/8] eventcounters: Optional ZONE_DMA
Date: Fri, 7 Jul 2006 17:05:17 -0700 (PDT)	[thread overview]
Message-ID: <20060708000517.3829.30693.sendpatchset@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20060708000501.3829.25578.sendpatchset@schroedinger.engr.sgi.com>

vmstat: Make ZONE_DMA support configurable

Do not display ZONE_DMA counters if no DMA zone is available.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.17-mm6/include/linux/vmstat.h
===================================================================
--- linux-2.6.17-mm6.orig/include/linux/vmstat.h	2006-07-06 18:44:59.763286559 -0700
+++ linux-2.6.17-mm6/include/linux/vmstat.h	2006-07-06 19:59:53.254972797 -0700
@@ -18,6 +18,12 @@
  * generated will simply be the increment of a global address.
  */
 
+#ifdef CONFIG_ZONE_DMA
+#define DMA_ZONE(xx) xx##_DMA,
+#else
+#define DMA_ZONE(xx)
+#endif
+
 #ifdef CONFIG_ZONE_DMA32
 #define DMA32_ZONE(xx) xx##_DMA32,
 #else
@@ -30,7 +36,7 @@
 #define HIGHMEM_ZONE(xx)
 #endif
 
-#define FOR_ALL_ZONES(xx) xx##_DMA, DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx)
+#define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx)
 
 enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
 		FOR_ALL_ZONES(PGALLOC),
@@ -88,9 +94,13 @@ extern void vm_events_fold_cpu(int cpu);
 
 #endif /* CONFIG_VM_EVENT_COUNTERS */
 
+#ifdef CONFIG_ZONE_DMA
 #define __count_zone_vm_events(item, zone, delta) \
 			__count_vm_events(item##_DMA + zone_idx(zone), delta)
-
+#else
+#define __count_zone_vm_events(item, zone, delta) \
+			__count_vm_events(item##_NORMAL + zone_idx(zone), delta)
+#endif
 /*
  * Zone based page accounting with per cpu differentials.
  */
@@ -136,14 +146,16 @@ static inline unsigned long node_page_st
 	struct zone *zones = NODE_DATA(node)->node_zones;
 
 	return
+#ifdef CONFIG_ZONE_DMA
+		zone_page_state(&zones[ZONE_DMA], item) +
+#endif
 #ifdef CONFIG_ZONE_DMA32
 		zone_page_state(&zones[ZONE_DMA32], item) +
 #endif
-		zone_page_state(&zones[ZONE_NORMAL], item) +
 #ifdef CONFIG_HIGHMEM
 		zone_page_state(&zones[ZONE_HIGHMEM], item) +
 #endif
-		zone_page_state(&zones[ZONE_DMA], item);
+		zone_page_state(&zones[ZONE_NORMAL], item);
 }
 
 extern void zone_statistics(struct zonelist *, struct zone *);
Index: linux-2.6.17-mm6/mm/vmstat.c
===================================================================
--- linux-2.6.17-mm6.orig/mm/vmstat.c	2006-07-06 18:44:59.764263061 -0700
+++ linux-2.6.17-mm6/mm/vmstat.c	2006-07-06 22:32:29.382408873 -0700
@@ -381,6 +381,12 @@ struct seq_operations fragmentation_op =
 	.show	= frag_show,
 };
 
+#ifdef CONFIG_ZONE_DMA
+#define TEXT_FOR_DMA(xx) xx "_dma",
+#else
+#define TEXT_FOR_DMA(xx)
+#endif
+
 #ifdef CONFIG_ZONE_DMA32
 #define TEXT_FOR_DMA32(xx) xx "_dma32",
 #else
@@ -393,7 +399,7 @@ struct seq_operations fragmentation_op =
 #define TEXT_FOR_HIGHMEM(xx)
 #endif
 
-#define TEXTS_FOR_ZONES(xx) xx "_dma", TEXT_FOR_DMA32(xx) xx "_normal", \
+#define TEXTS_FOR_ZONES(xx) TEXT_FOR_DMA(xx) TEXT_FOR_DMA32(xx) xx "_normal", \
 					TEXT_FOR_HIGHMEM(xx)
 
 static char *vmstat_text[] = {

  parent reply	other threads:[~2006-07-08  0:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-08  0:05 [RFC 0/8] Optional ZONE_DMA Christoph Lameter
2006-07-08  0:05 ` [RFC 1/8] Add CONFIG_ZONE_DMA to all archesM Christoph Lameter
2006-07-10  0:52   ` KAMEZAWA Hiroyuki
2006-07-10 15:56     ` Christoph Lameter
2006-07-11  7:11       ` KAMEZAWA Hiroyuki
2006-07-08  0:05 ` [RFC 2/8] slab allocator: Make DMA support configurable Christoph Lameter
2006-07-08  0:05 ` Christoph Lameter [this message]
2006-07-08  0:05 ` [RFC 4/8] page allocator: Optional ZONE_DMA Christoph Lameter
2006-07-08  0:23   ` Andi Kleen
2006-07-08  0:41     ` Christoph Lameter
2006-07-08  0:05 ` [RFC 5/8] x86_64 without ZONE_DMA Christoph Lameter
2006-07-08  0:20   ` Andi Kleen
2006-07-08  0:42     ` Christoph Lameter
2006-07-08  1:00       ` Andi Kleen
2006-07-08  1:25         ` Christoph Lameter
2006-07-08  0:05 ` [RFC 6/8] i386 " Christoph Lameter
2006-07-08  0:05 ` [RFC 7/8] Single zone optimizations Christoph Lameter
2006-07-08  0:19   ` Andi Kleen
2006-07-08  0:05 ` [RFC 8/8] Optimize mempolicies for a single zone Christoph Lameter
2006-07-08  0:17   ` Andi Kleen

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=20060708000517.3829.30693.sendpatchset@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=ak@suse.de \
    --cc=arjan@infradead.org \
    --cc=hch@infradead.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@kvack.org \
    --cc=mbligh@google.com \
    --cc=nickpiggin@yahoo.com.au \
    /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