From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andre Przywara" Subject: [PATCH] add per-node summary for heap info Date: Fri, 21 Dec 2007 23:41:06 +0100 Message-ID: <476C4102.3060206@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=------------020702050703040207020301 Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------020702050703040207020301 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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-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 --------------020702050703040207020301 Content-Type: text/plain; name=node_summary.diff Content-Disposition: inline; filename=node_summary.diff Content-Transfer-Encoding: quoted-printable # HG changeset patch # User Andr=E9 Przywara # 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 =3D NOW(); int i, j; + unsigned long sumpernode [ MAX_NUMNODES * 2 ]; =20 printk("'%c' pressed -> dumping heap info (now-0x%X:%08X)\n", key, (u32)(now>>32), (u32)now); =20 for ( i =3D 0; i < MAX_NUMNODES; i++ ) { + sumpernode[ i * 2 ] =3D 0; sumpernode[ i * 2 + 1 ] =3D 0; if ( !avail[i] ) continue; for ( j =3D 0; j < NR_ZONES; j++ ) + { printk("heap[node=3D%d][zone=3D%d] -> %lu pages\n", i, j, avail[i][j]); - } + sumpernode[i*2+(j<(dma_bitsize - PAGE_SHIFT)?0:1)]+=3Davail[= i][j]; + } + } + + for ( i =3D 0; i < MAX_NUMNODES; i++ ) + { + if ( !avail[i] ) + continue; + printk("head[node=3D%d][dmazone] -> %lu pages\n", i, + sumpernode[ i * 2 ]); + printk("head[node=3D%d][highzone] -> %lu pages\n", i, + sumpernode[ i * 2 + 1 ]); + printk("head[node=3D%d][allzones] -> %lu pages\n", i, + sumpernode[i*2] + sumpernode[i*2+1]); + } + } =20 static __init int register_heap_trigger(void) --------------020702050703040207020301 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------020702050703040207020301--