Skip to contentSkip to conversation

dump available order allocations in each zone while dumping heap information

PATCH Superseded Karim Raslan 2 participants 3 messages Jan 5, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dump available order allocations in each zone while dumping heap information

---
 xen/common/page_alloc.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
xen/common/page_alloc.c +10 -1
index 5f484a2..5419b3f 100644
@@ -1673,7 +1673,7 @@ void scrub_one_page(struct page_info *pg)
 static void dump_heap(unsigned char key)
 {
     s_time_t      now = NOW();
-    int           i, j;
+    int           i, j, k;
 
     printk("'%c' pressed -> dumping heap info (now-0x%X:%08X)\n", key,
            (u32)(now>>32), (u32)now);
@@ -1683,8 +1683,17 @@ static void dump_heap(unsigned char key)
         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]);
+            if(avail[i][j]) {
+            	printk("\t(In:\n");
+				for ( k = 0; k < MAX_ORDER; k++)
+					if(!page_list_empty(&heap(i, j, k)))
+						printk("  \t[order=%d]\n",k);
+				printk(")\n");
+            }
+        }
     }
 }
 
Signature · 1 line
1.7.9.5
#1 lore raw

Hi Karim,

(+ adding maintainers) Don't forget the maintainers, you can use scripts/get_maintainers.pl.

Quoted 19 lines · Karim Raslan
---
  xen/common/page_alloc.c |   11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
xen/common/page_alloc.c +1 -1
index 5f484a2..5419b3f 100644
@@ -1673,7 +1673,7 @@ void scrub_one_page(struct page_info *pg)
  static void dump_heap(unsigned char key)
  {
      s_time_t      now = NOW();
-    int           i, j;
+    int           i, j, k;
 
      printk("'%c' pressed -> dumping heap info (now-0x%X:%08X)\n", key,
             (u32)(now>>32), (u32)now);

xen/common/page_alloc.c static void dump_heap(unsigned char key) · line 1689

Quoted 7 lines
xen/common/page_alloc.c +2 -0
@@ -1683,8 +1683,17 @@ static void dump_heap(unsigned char key)
          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]);
+            if(avail[i][j]) {

if ( .. )
{

You are using Linux coding style, not Xen. See CODING_STYLE in the root of the repository.

xen/common/page_alloc.c static void dump_heap(unsigned char key) · line 1690

Quoted 1 line
xen/common/page_alloc.c +1 -0
+            	printk("\t(In:\n");

We don't use tabulations on Xen, please use spaces (same for the next 4 lines).

xen/common/page_alloc.c static void dump_heap(unsigned char key) · line 1692

Quoted 2 lines
xen/common/page_alloc.c +2 -0
+				for ( k = 0; k < MAX_ORDER; k++)
+					if(!page_list_empty(&heap(i, j, k)))

if ( .. )

xen/common/page_alloc.c static void dump_heap(unsigned char key) · line 1699

Quoted 8 lines
xen/common/page_alloc.c +4 -0
+						printk("  \t[order=%d]\n",k);
+				printk(")\n");
+            }
+        }
      }
  }
 

Sincerely yours,

Signature · 1 line
Julien Grall
#2 lore raw

Thanks Julien for your comments, reposting.

Quoted 72 lines · Julien Grall

Hi Karim,

(+ adding maintainers) Don't forget the maintainers, you can use scripts/get_maintainers.pl.

Quoted 20 lines · Karim Raslan
---
  xen/common/page_alloc.c |   11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
xen/common/page_alloc.c +1 -1
index 5f484a2..5419b3f 100644
@@ -1673,7 +1673,7 @@ void scrub_one_page(struct page_info *pg)
  static void dump_heap(unsigned char key)
  {
      s_time_t      now = NOW();
-    int           i, j;
+    int           i, j, k;
 
      printk("'%c' pressed -> dumping heap info (now-0x%X:%08X)\n", key,
             (u32)(now>>32), (u32)now);

xen/common/page_alloc.c static void dump_heap(unsigned char key) · line 1689

Quoted 7 lines
xen/common/page_alloc.c +2 -0
@@ -1683,8 +1683,17 @@ static void dump_heap(unsigned char key)
          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]);
+            if(avail[i][j]) {

if ( .. )
{

You are using Linux coding style, not Xen. See CODING_STYLE in the root of the repository.

xen/common/page_alloc.c static void dump_heap(unsigned char key) · line 1690

Quoted 1 line
xen/common/page_alloc.c +1 -0
+               printk("\t(In:\n");

We don't use tabulations on Xen, please use spaces (same for the next 4 lines).

xen/common/page_alloc.c static void dump_heap(unsigned char key) · line 1693

Quoted 3 lines
xen/common/page_alloc.c +2 -0
+                               for ( k = 0; k < MAX_ORDER; k++)
+                                       if(!page_list_empty(&heap(i, j,
 k)))

if ( .. )

Quoted 9 lines
xen/common/page_alloc.c +4 -0
+                                               printk("
 \t[order=%d]\n",k);
+                               printk(")\n");
+            }
+        }
      }
  }

Sincerely yours,

--
Julien Grall

Signature · 2 lines
Karim Allah Ahmed.
LinkedIn