Skip to contentSkip to conversation

xen: adds vNUMA info debug-key u

PATCH Superseded Elena Ufimtseva 2 participants 2 messages Oct 16, 2013 – Oct 17, 2013

v1 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

PATCH 6/7 xen: adds vNUMA info debug-key u

Prints basic information about vNUMA topology for vNUMA enabled domains when issuing debug-key 'u'.

---
Changes since RFC v2:
- added check for no node mapping and displays it as -1;
- modified the output on per vnode basis;

---
 xen/arch/x86/numa.c |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
xen/arch/x86/numa.c +19 -1
index b141877..c826b1b 100644
@@ -347,7 +347,7 @@ EXPORT_SYMBOL(node_data);
 static void dump_numa(unsigned char key)
 {
 	s_time_t now = NOW();
-	int i;
+	int i, j;
 	struct domain *d;
 	struct page_info *page;
 	unsigned int page_num_node[MAX_NUMNODES];
@@ -389,6 +389,24 @@ static void dump_numa(unsigned char key)
 
 		for_each_online_node(i)
 			printk("    Node %u: %u\n", i, page_num_node[i]);
+
+                if (d->vnuma.nr_vnodes > 0) 
+                {
+                    printk("    Domain has %d vnodes\n", d->vnuma.nr_vnodes);
+                    for(j = 0; j < d->vnuma.nr_vnodes; j++) {
+                        printk("        vnode %d - pnode %d:", j,
+                                        d->vnuma.vnode_to_pnode[j] > MAX_NUMNODES ?
+                                        -1 : d->vnuma.vnode_to_pnode[j]); 
+                        printk(" %Lu MB, \n", (unsigned long long) 
+                                           (d->vnuma.vnuma_memblks[j].end -
+                                           d->vnuma.vnuma_memblks[j].start) 
+                                           >> 20);
+                        }
+                    printk("    Domain vcpu to vnode: ");
+                    for(j = 0; j < d->max_vcpus; j++) 
+                        printk("%d ", d->vnuma.vcpu_to_vnode[j]);
+                    printk("\n");
+                }
 	}
 
 	rcu_read_unlock(&domlist_read_lock);
Signature · 1 line
1.7.10.4
#1 lore raw

xen/arch/x86/numa.c static void dump_numa(unsigned char key) · line 393

Quoted 7 lines
Quoted 1 line
Quoted 1 line · Elena Ufimtseva
xen/arch/x86/numa.c +2 -0
@@ -389,6 +389,24 @@ static void dump_numa(unsigned char key)
 
 		for_each_online_node(i)
 			printk("    Node %u: %u\n", i, page_num_node[i]);
+
+                if (d->vnuma.nr_vnodes > 0) 

The file/function so far uses tab indentation, and hence so should you.

xen/arch/x86/numa.c static void dump_numa(unsigned char key) · line 396

Quoted 3 lines
xen/arch/x86/numa.c +3 -0
+                {
+                    printk("    Domain has %d vnodes\n", d->vnuma.nr_vnodes);
+                    for(j = 0; j < d->vnuma.nr_vnodes; j++) {

Coding style.

Also, what's the point of using a new variable "j" here when the available "i" could be re-used?

xen/arch/x86/numa.c static void dump_numa(unsigned char key) · line 398

Quoted 2 lines
xen/arch/x86/numa.c +2 -0
+                        printk("        vnode %d - pnode %d:", j,
+                                        d->vnuma.vnode_to_pnode[j] > MAX_NUMNODES ?

Didn't you mean >= ?

xen/arch/x86/numa.c static void dump_numa(unsigned char key) · line 400

Quoted 2 lines
xen/arch/x86/numa.c +2 -0
+                                        -1 : d->vnuma.vnode_to_pnode[j]); 
+                        printk(" %Lu MB, \n", (unsigned long long) 

%"PRIu64" and no cast please. And what's the space good for immediately preceding the \n in the format string?

xen/arch/x86/numa.c static void dump_numa(unsigned char key) · line 406

Quoted 6 lines
xen/arch/x86/numa.c +6 -0
+                                           (d->vnuma.vnuma_memblks[j].end -
+                                           d->vnuma.vnuma_memblks[j].start) 
+                                           >> 20);
+                        }
+                    printk("    Domain vcpu to vnode: ");
+                    for(j = 0; j < d->max_vcpus; j++) 

Coding style again.

xen/arch/x86/numa.c static void dump_numa(unsigned char key) · line 407

Quoted 1 line
xen/arch/x86/numa.c +1 -0
+                        printk("%d ", d->vnuma.vcpu_to_vnode[j]);

So with a 64-vCPU guest I'm going to get an over 200 characters long line? Please properly wrap such potentially long output.

Jan