All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] add per-node summary for heap info
@ 2007-12-21 22:41 Andre Przywara
  0 siblings, 0 replies; only message in thread
From: Andre Przywara @ 2007-12-21 22:41 UTC (permalink / raw)
  To: xen-devel

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

When dumping heap info (using the Xen console handlers, e.g. CTRL-a) 
there are entries printed for each node and zone combination. This is 
helpful, but summarizing the node's memory usage would be better. This 
patch adds three lines per node after the heap dump. The first line 
shows the number of DMA-capable pages, the second one the number of 
higher pages, the third is the sum of these both numbers.
Proves useful when debugging NUMA handling.

Andre.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>

-- 
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 277-84917
----to satisfy European Law for business letters:
AMD Saxony Limited Liability Company & Co. KG,
Wilschdorfer Landstr. 101, 01109 Dresden, Germany
Register Court Dresden: HRA 4896, General Partner authorized
to represent: AMD Saxony LLC (Wilmington, Delaware, US)
General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy

[-- Attachment #2: node_summary.diff --]
[-- Type: text/plain, Size: 1633 bytes --]

# HG changeset patch
# User André Przywara <andre.przywara@amd.com>
# Date 1198270784 -3600
# Node ID be672cea6a62e04f0e420ce4794a85846efe6be2
# Parent  1a9f3e26552d9913c3771d874c342a3262e5addf
added per-node heap summary

diff -r 1a9f3e26552d -r be672cea6a62 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Fri Dec 21 17:34:38 2007 +0100
+++ b/xen/common/page_alloc.c	Fri Dec 21 21:59:44 2007 +0100
@@ -1040,18 +1040,36 @@ static void dump_heap(unsigned char key)
 {
     s_time_t      now = NOW();
     int           i, j;
+    unsigned long sumpernode [ MAX_NUMNODES * 2 ];
 
     printk("'%c' pressed -> dumping heap info (now-0x%X:%08X)\n", key,
            (u32)(now>>32), (u32)now);
 
     for ( i = 0; i < MAX_NUMNODES; i++ )
     {
+        sumpernode[ i * 2 ] = 0; sumpernode[ i * 2 + 1 ] = 0;
         if ( !avail[i] )
             continue;
         for ( j = 0; j < NR_ZONES; j++ )
+        {
             printk("heap[node=%d][zone=%d] -> %lu pages\n",
                    i, j, avail[i][j]);
-    }
+            sumpernode[i*2+(j<(dma_bitsize - PAGE_SHIFT)?0:1)]+=avail[i][j];
+        }
+    }
+
+    for ( i = 0; i < MAX_NUMNODES; i++ )
+    {
+        if ( !avail[i] )
+            continue;
+        printk("head[node=%d][dmazone]  -> %lu pages\n", i,
+            sumpernode[ i * 2 ]);
+        printk("head[node=%d][highzone] -> %lu pages\n", i,
+            sumpernode[ i * 2 + 1 ]);
+        printk("head[node=%d][allzones] -> %lu pages\n", i,
+            sumpernode[i*2] + sumpernode[i*2+1]);
+    }
+
 }
 
 static __init int register_heap_trigger(void)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-21 22:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-21 22:41 [PATCH] add per-node summary for heap info Andre Przywara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.