xen/vNUMA: adds vNUMA to NUMA debug-key
RFC PATCH v2 7/7 xen/vNUMA: adds vNUMA to NUMA debug-key
Prints basic information about vNUMA topology for vNUMA enabled domains when issuing debug-key 'u'.
--- xen/arch/x86/numa.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
xen/arch/x86/numa.c +22 -1
@@ -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,27 @@ 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_each_online_node (i) + { + +printk (" pnode %d: vnodes: " , i); +for (j =0 ; j < d->vnuma.nr_vnodes; j++) { +if (d->vnuma.vnode_to_pnode[j] == i) +printk ("%d (%Lu), " , j, (unsigned long long ) + (d->vnuma.vnuma_memblks[j].end - + d->vnuma.vnuma_memblks[j].start) + >>20 ); + } +printk ("\n" ); + } +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
Quoted 22 lines · Elena Ufimtseva
Prints basic information about vNUMA topology for vNUMA enabled domains when issuing debug-key 'u'.
Signed-off-by Elena Ufimtseva <[email protected]>--- xen/arch/x86/numa.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)xen/arch/x86/numa.c +1
-1@@ -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 ];
xen/arch/x86/numa.c static void dump_numa(unsigned char key) · line 391
Quoted 3 lines
xen/arch/x86/numa.c +0
-0@@ -389,6 +389,27 @@ static void dump_numa(unsigned char key)for_each_online_node (i)printk (" Node %u: %u\n" , i, page_num_node[i]);
Blank line
xen/arch/x86/numa.c static void dump_numa(unsigned char key) · line 394
Quoted 3 lines
xen/arch/x86/numa.c +3
-0+if (d->vnuma.nr_vnodes >0 ) + { +printk (" Domain has %d vnodes\n" , d->vnuma.nr_vnodes);
Blank line, &c
xen/arch/x86/numa.c static void dump_numa(unsigned char key) · line 397
Quoted 3 lines
xen/arch/x86/numa.c +3
-0+for_each_online_node (i) + { +
Remove this blank line. :-)
xen/arch/x86/numa.c static void dump_numa(unsigned char key) · line 404
Quoted 7 lines
xen/arch/x86/numa.c +7
-0+printk (" pnode %d: vnodes: " , i); +for (j =0 ; j < d->vnuma.nr_vnodes; j++) { +if (d->vnuma.vnode_to_pnode[j] == i) +printk ("%d (%Lu), " , j, (unsigned long long ) + (d->vnuma.vnuma_memblks[j].end - + d->vnuma.vnuma_memblks[j].start) + >>20 );
I think here it probable makes sense to be more vnuma-centric rather than pnuma centric: Rather than print the vnodes sorted by pnodes, just print the vnodes and print the pnode associated with it. That gets rid of the need for the extra nest of the loop.
Other than that (and the blank lines) it looks good.
-George
Quoted 24 lines · George Dunlap
Quoted 23 lines · Elena Ufimtseva
Prints basic information about vNUMA topology for vNUMA enabled domains when issuing debug-key 'u'.
Signed-off-by Elena Ufimtseva <[email protected]>--- xen/arch/x86/numa.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)xen/arch/x86/numa.c +1
-1@@ -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,27 @@ static void dump_numa(unsigned char key)
Quoted 6 lines
xen/arch/x86/numa.c static void dump_numa(unsigned char key) · line 391
Quoted 2 lines
xen/arch/x86/numa.c +0
-0for_each_online_node (i)printk (" Node %u: %u\n" , i, page_num_node[i]);Blank line
Quoted 1 line
xen/arch/x86/numa.c +1
-0+if (d->vnuma.nr_vnodes >0 )
I think you need a space there between the 'if' and '('..
Quoted 32 lines
xen/arch/x86/numa.c static void dump_numa(unsigned char key) · line 394
Quoted 2 lines
xen/arch/x86/numa.c +2
-0+ { +printk (" Domain has %d vnodes\n" , d->vnuma.nr_vnodes);Blank line, &c
xen/arch/x86/numa.c static void dump_numa(unsigned char key) · line 397
Quoted 3 lines
xen/arch/x86/numa.c +3
-0+for_each_online_node (i) + { +Remove this blank line. :-)
xen/arch/x86/numa.c static void dump_numa(unsigned char key) · line 404
Quoted 7 lines
xen/arch/x86/numa.c +7
-0+printk (" pnode %d: vnodes: " , i); +for (j =0 ; j < d->vnuma.nr_vnodes; j++) { +if (d->vnuma.vnode_to_pnode[j] == i) +printk ("%d (%Lu), " , j, (unsigned long long ) + (d->vnuma.vnuma_memblks[j].end - + d->vnuma.vnuma_memblks[j].start) + >>20 );I think here it probable makes sense to be more vnuma-centric rather than pnuma centric: Rather than print the vnodes sorted by pnodes, just print the vnodes and print the pnode associated with it. That gets rid of the need for the extra nest of the loop.
Other than that (and the blank lines) it looks good.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel