linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC - Patch] Condense output of show_free_areas()
@ 2006-09-14 13:30 Jes Sorensen
  2006-09-15  6:08 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Jes Sorensen @ 2006-09-14 13:30 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel, linux-ia64, Andrew Morton

Hi,

On larger systems, the amount of output dumped on the console when you
do SysRq-M is beyond insane. This patch is trying to reduce it
somewhat as even with the smaller NUMA systems that have hit the
desktop this seems to be a fair thing to do.

The philosophy I have taken is as follows:
 1) If a zone is empty, don't tell, we don't need yet another line
    telling us so. The information is available since one can look up
    the fact how many zones were initialized in the first place.
 2) Put as much information on a line is possible, if it can be done
    in one line, rahter than two, then do it in one. I tried to format
    the temperature stuff for easy reading.

Comments?

Cheers,
Jes

Change show_free_areas() to not print lines for empty zones. If no zone
output is printed, the zone is empty. This reduces the number of lines
dumped to the console in sysrq on a large system by several thousand
lines.

Change the zone temperature printouts to use one line per CPU instead
of two lines (one hot, one cold). On a 1024 CPU, 1024 node system, this
reduces the console output by over a million lines of output.

While this is a bigger problem on large NUMA systems, it is also
applicable to smaller desktop sized and mid range NUMA systems.

Signed-off-by: Jes Sorensen <jes@sgi.com>


---
 mm/page_alloc.c |   36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)

Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c
+++ linux-2.6/mm/page_alloc.c
@@ -1249,34 +1249,30 @@ void si_meminfo_node(struct sysinfo *val
  */
 void show_free_areas(void)
 {
-	int cpu, temperature;
+	int cpu;
 	unsigned long active;
 	unsigned long inactive;
 	unsigned long free;
 	struct zone *zone;
 
 	for_each_zone(zone) {
-		show_node(zone);
-		printk("%s per-cpu:", zone->name);
-
-		if (!populated_zone(zone)) {
-			printk(" empty\n");
+		if (!populated_zone(zone))
 			continue;
-		} else
-			printk("\n");
+
+		show_node(zone);
+		printk("%s per-cpu:\n", zone->name);
 
 		for_each_online_cpu(cpu) {
 			struct per_cpu_pageset *pageset;
 
 			pageset = zone_pcp(zone, cpu);
 
-			for (temperature = 0; temperature < 2; temperature++)
-				printk("cpu %d %s: high %d, batch %d used:%d\n",
-					cpu,
-					temperature ? "cold" : "hot",
-					pageset->pcp[temperature].high,
-					pageset->pcp[temperature].batch,
-					pageset->pcp[temperature].count);
+			printk("CPU %4d: Hot: hi:%5d, btch:%4d usd:%4d   "
+			       "Cold: hi:%5d, btch:%4d usd:%4d\n",
+			       cpu, pageset->pcp[0].high,
+			       pageset->pcp[0].batch, pageset->pcp[0].count,
+			       pageset->pcp[1].high, pageset->pcp[1].batch,
+			       pageset->pcp[1].count);
 		}
 	}
 
@@ -1301,6 +1297,9 @@ void show_free_areas(void)
 	for_each_zone(zone) {
 		int i;
 
+		if (!populated_zone(zone))
+			continue;
+
 		show_node(zone);
 		printk("%s"
 			" free:%lukB"
@@ -1333,12 +1332,11 @@ void show_free_areas(void)
 	for_each_zone(zone) {
  		unsigned long nr[MAX_ORDER], flags, order, total = 0;
 
+		if (!populated_zone(zone))
+			continue;
+
 		show_node(zone);
 		printk("%s: ", zone->name);
-		if (!populated_zone(zone)) {
-			printk("empty\n");
-			continue;
-		}
 
 		spin_lock_irqsave(&zone->lock, flags);
 		for (order = 0; order < MAX_ORDER; order++) {

--
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] 3+ messages in thread

* Re: [RFC - Patch] Condense output of show_free_areas()
  2006-09-14 13:30 [RFC - Patch] Condense output of show_free_areas() Jes Sorensen
@ 2006-09-15  6:08 ` Andrew Morton
  2006-09-15  9:45   ` Jes Sorensen
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2006-09-15  6:08 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: linux-mm, linux-kernel, linux-ia64

On 14 Sep 2006 09:30:58 -0400
Jes Sorensen <jes@sgi.com> wrote:

> On larger systems, the amount of output dumped on the console when you
> do SysRq-M is beyond insane. This patch is trying to reduce it
> somewhat as even with the smaller NUMA systems that have hit the
> desktop this seems to be a fair thing to do.
> 
> The philosophy I have taken is as follows:
>  1) If a zone is empty, don't tell, we don't need yet another line
>     telling us so. The information is available since one can look up
>     the fact how many zones were initialized in the first place.
>  2) Put as much information on a line is possible, if it can be done
>     in one line, rahter than two, then do it in one. I tried to format
>     the temperature stuff for easy reading.
> 
> Comments?
> 
> Cheers,
> Jes
> 
> Change show_free_areas() to not print lines for empty zones. If no zone
> output is printed, the zone is empty. This reduces the number of lines
> dumped to the console in sysrq on a large system by several thousand
> lines.
> 
> Change the zone temperature printouts to use one line per CPU instead
> of two lines (one hot, one cold). On a 1024 CPU, 1024 node system, this
> reduces the console output by over a million lines of output.
> 
> While this is a bigger problem on large NUMA systems, it is also
> applicable to smaller desktop sized and mid range NUMA systems.

Could you please send us an example of the new output for review,
and for me to include in the changelog?  Thanks.

--
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] 3+ messages in thread

* Re: [RFC - Patch] Condense output of show_free_areas()
  2006-09-15  6:08 ` Andrew Morton
@ 2006-09-15  9:45   ` Jes Sorensen
  0 siblings, 0 replies; 3+ messages in thread
From: Jes Sorensen @ 2006-09-15  9:45 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linux-kernel, linux-ia64

[-- Attachment #1: Type: text/plain, Size: 657 bytes --]

Andrew Morton wrote:
> On 14 Sep 2006 09:30:58 -0400 Jes Sorensen <jes@sgi.com> wrote:
>> While this is a bigger problem on large NUMA systems, it is also
>> applicable to smaller desktop sized and mid range NUMA systems.
> 
> Could you please send us an example of the new output for review,
> and for me to include in the changelog?  Thanks.

Whoops, should have thought of that. Note the output is formatted for
80 columns, so it may look a little dodgy in 72 columns - attached it
instead.

Sorry it's a bit large, but needed to show the difference, but feel free
to clip out the middle CPUs or something. This is from a 4-node 8-cpu
box.

Cheers,
Jes


[-- Attachment #2: format-compare.txt --]
[-- Type: text/plain, Size: 2887 bytes --]

Old format:

Mem-info:
Node 0 DMA per-cpu:
cpu 0 hot: high 42, batch 7 used:24
cpu 0 cold: high 14, batch 3 used:1
cpu 1 hot: high 42, batch 7 used:34
cpu 1 cold: high 14, batch 3 used:0
cpu 2 hot: high 42, batch 7 used:0
cpu 2 cold: high 14, batch 3 used:0
cpu 3 hot: high 42, batch 7 used:0
cpu 3 cold: high 14, batch 3 used:0
cpu 4 hot: high 42, batch 7 used:0
cpu 4 cold: high 14, batch 3 used:0
cpu 5 hot: high 42, batch 7 used:0
cpu 5 cold: high 14, batch 3 used:0
cpu 6 hot: high 42, batch 7 used:0
cpu 6 cold: high 14, batch 3 used:0
cpu 7 hot: high 42, batch 7 used:0
cpu 7 cold: high 14, batch 3 used:0
Node 0 DMA32 per-cpu: empty
Node 0 Normal per-cpu: empty
Node 0 HighMem per-cpu: empty
Node 1 DMA per-cpu:
[snip]
Free pages:     5410688kB (0kB HighMem)
Active:9536 inactive:4261 dirty:6 writeback:0 unstable:0 free:338168 slab:1931 mapped:1900 pagetables:208
Node 0 DMA free:1676304kB min:3264kB low:4080kB high:4896kB active:128048kB inactive:61568kB present:1970880kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
Node 0 DMA32 free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
Node 0 Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
Node 0 HighMem free:0kB min:512kB low:512kB high:512kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
Node 1 DMA free:1951728kB min:3280kB low:4096kB high:4912kB active:5632kB inactive:1504kB present:1982464kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
....

New format:

Mem-info:
Node 0 DMA per-cpu:
CPU    0: Hot: hi:   42, btch:   7 usd:  41   Cold: hi:   14, btch:   3 usd:   2
CPU    1: Hot: hi:   42, btch:   7 usd:  40   Cold: hi:   14, btch:   3 usd:   1
CPU    2: Hot: hi:   42, btch:   7 usd:   0   Cold: hi:   14, btch:   3 usd:   0
CPU    3: Hot: hi:   42, btch:   7 usd:   0   Cold: hi:   14, btch:   3 usd:   0
CPU    4: Hot: hi:   42, btch:   7 usd:   0   Cold: hi:   14, btch:   3 usd:   0
CPU    5: Hot: hi:   42, btch:   7 usd:   0   Cold: hi:   14, btch:   3 usd:   0
CPU    6: Hot: hi:   42, btch:   7 usd:   0   Cold: hi:   14, btch:   3 usd:   0
CPU    7: Hot: hi:   42, btch:   7 usd:   0   Cold: hi:   14, btch:   3 usd:   0
Node 1 DMA per-cpu:
[snip]
Free pages:     5411088kB (0kB HighMem)
Active:9558 inactive:4233 dirty:6 writeback:0 unstable:0 free:338193 slab:1942 mapped:1918 pagetables:208
Node 0 DMA free:1677648kB min:3264kB low:4080kB high:4896kB active:129296kB inactive:58864kB present:1970880kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
Node 1 DMA free:1948448kB min:3280kB low:4096kB high:4912kB active:6864kB inactive:3536kB present:1982464kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-09-15  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-14 13:30 [RFC - Patch] Condense output of show_free_areas() Jes Sorensen
2006-09-15  6:08 ` Andrew Morton
2006-09-15  9:45   ` Jes Sorensen

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