aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJes Sorensen <jes@sgi.com>2006-09-27 04:50:05 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-27 11:26:12 -0400
commitc72419138fa34e1bc1f1c6fa54ee77df55a05ed0 (patch)
tree293e2d11f5d4b8487aeccbb4eca71f3572012c17
parentde3083ec3e6bfb1ab60bc8a410f37702529f953c (diff)
[PATCH] Condense output of show_free_areas()
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. 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. 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 Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--mm/page_alloc.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index acbf58f8a1b7..8a6418b0d2c5 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1305,34 +1305,30 @@ void si_meminfo_node(struct sysinfo *val, int nid)
1305 */ 1305 */
1306void show_free_areas(void) 1306void show_free_areas(void)
1307{ 1307{
1308 int cpu, temperature; 1308 int cpu;
1309 unsigned long active; 1309 unsigned long active;
1310 unsigned long inactive; 1310 unsigned long inactive;
1311 unsigned long free; 1311 unsigned long free;
1312 struct zone *zone; 1312 struct zone *zone;
1313 1313
1314 for_each_zone(zone) { 1314 for_each_zone(zone) {
1315 show_node(zone); 1315 if (!populated_zone(zone))
1316 printk("%s per-cpu:", zone->name);
1317
1318 if (!populated_zone(zone)) {
1319 printk(" empty\n");
1320 continue; 1316 continue;
1321 } else 1317
1322 printk("\n"); 1318 show_node(zone);
1319 printk("%s per-cpu:\n", zone->name);
1323 1320
1324 for_each_online_cpu(cpu) { 1321 for_each_online_cpu(cpu) {
1325 struct per_cpu_pageset *pageset; 1322 struct per_cpu_pageset *pageset;
1326 1323
1327 pageset = zone_pcp(zone, cpu); 1324 pageset = zone_pcp(zone, cpu);
1328 1325
1329 for (temperature = 0; temperature < 2; temperature++) 1326 printk("CPU %4d: Hot: hi:%5d, btch:%4d usd:%4d "
1330 printk("cpu %d %s: high %d, batch %d used:%d\n", 1327 "Cold: hi:%5d, btch:%4d usd:%4d\n",
1331 cpu, 1328 cpu, pageset->pcp[0].high,
1332 temperature ? "cold" : "hot", 1329 pageset->pcp[0].batch, pageset->pcp[0].count,
1333 pageset->pcp[temperature].high, 1330 pageset->pcp[1].high, pageset->pcp[1].batch,
1334 pageset->pcp[temperature].batch, 1331 pageset->pcp[1].count);
1335 pageset->pcp[temperature].count);
1336 } 1332 }
1337 } 1333 }
1338 1334
@@ -1354,6 +1350,9 @@ void show_free_areas(void)
1354 for_each_zone(zone) { 1350 for_each_zone(zone) {
1355 int i; 1351 int i;
1356 1352
1353 if (!populated_zone(zone))
1354 continue;
1355
1357 show_node(zone); 1356 show_node(zone);
1358 printk("%s" 1357 printk("%s"
1359 " free:%lukB" 1358 " free:%lukB"
@@ -1386,12 +1385,11 @@ void show_free_areas(void)
1386 for_each_zone(zone) { 1385 for_each_zone(zone) {
1387 unsigned long nr[MAX_ORDER], flags, order, total = 0; 1386 unsigned long nr[MAX_ORDER], flags, order, total = 0;
1388 1387
1388 if (!populated_zone(zone))
1389 continue;
1390
1389 show_node(zone); 1391 show_node(zone);
1390 printk("%s: ", zone->name); 1392 printk("%s: ", zone->name);
1391 if (!populated_zone(zone)) {
1392 printk("empty\n");
1393 continue;
1394 }
1395 1393
1396 spin_lock_irqsave(&zone->lock, flags); 1394 spin_lock_irqsave(&zone->lock, flags);
1397 for (order = 0; order < MAX_ORDER; order++) { 1395 for (order = 0; order < MAX_ORDER; order++) {