mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
x86: dump vNUMA information with debug key 'u'
Signed-off-by: Elena Ufimsteva <ufimtseva@gmail.com> Signed-off-by: Wei Liu <wei.liu2@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
This commit is contained in:
1 parent
9f4d5f2037
commit
2cd5eff896
1 file changed
+70
-1
+70
-1
@@ -16,6 +16,7 @@
|
||||
#include <xen/pfn.h>
|
||||
#include <asm/acpi.h>
|
||||
#include <xen/sched.h>
|
||||
#include <xen/softirq.h>
|
||||
|
||||
static int numa_setup(char *s);
|
||||
custom_param("numa", numa_setup);
|
||||
@@ -363,10 +364,12 @@ EXPORT_SYMBOL(node_data);
|
||||
static void dump_numa(unsigned char key)
|
||||
{
|
||||
s_time_t now = NOW();
|
||||
int i;
|
||||
unsigned int i, j;
|
||||
int err;
|
||||
struct domain *d;
|
||||
struct page_info *page;
|
||||
unsigned int page_num_node[MAX_NUMNODES];
|
||||
const struct vnuma_info *vnuma;
|
||||
|
||||
printk("'%c' pressed -> dumping numa info (now-0x%X:%08X)\n", key,
|
||||
(u32)(now>>32), (u32)now);
|
||||
@@ -393,6 +396,8 @@ static void dump_numa(unsigned char key)
|
||||
printk("Memory location of each domain:\n");
|
||||
for_each_domain ( d )
|
||||
{
|
||||
process_pending_softirqs();
|
||||
|
||||
printk("Domain %u (total: %u):\n", d->domain_id, d->tot_pages);
|
||||
|
||||
for_each_online_node ( i )
|
||||
@@ -408,6 +413,70 @@ static void dump_numa(unsigned char key)
|
||||
|
||||
for_each_online_node ( i )
|
||||
printk(" Node %u: %u\n", i, page_num_node[i]);
|
||||
|
||||
if ( !read_trylock(&d->vnuma_rwlock) )
|
||||
continue;
|
||||
|
||||
if ( !d->vnuma )
|
||||
{
|
||||
read_unlock(&d->vnuma_rwlock);
|
||||
continue;
|
||||
}
|
||||
|
||||
vnuma = d->vnuma;
|
||||
printk(" %u vnodes, %u vcpus, guest physical layout:\n",
|
||||
vnuma->nr_vnodes, d->max_vcpus);
|
||||
for ( i = 0; i < vnuma->nr_vnodes; i++ )
|
||||
{
|
||||
unsigned int start_cpu = ~0U;
|
||||
|
||||
err = snprintf(keyhandler_scratch, 12, "%3u",
|
||||
vnuma->vnode_to_pnode[i]);
|
||||
if ( err < 0 || vnuma->vnode_to_pnode[i] == NUMA_NO_NODE )
|
||||
strlcpy(keyhandler_scratch, "???", sizeof(keyhandler_scratch));
|
||||
|
||||
printk(" %3u: pnode %s,", i, keyhandler_scratch);
|
||||
|
||||
printk(" vcpus ");
|
||||
|
||||
for ( j = 0; j < d->max_vcpus; j++ )
|
||||
{
|
||||
if ( !(j & 0x3f) )
|
||||
process_pending_softirqs();
|
||||
|
||||
if ( vnuma->vcpu_to_vnode[j] == i )
|
||||
{
|
||||
if ( start_cpu == ~0U )
|
||||
{
|
||||
printk("%d", j);
|
||||
start_cpu = j;
|
||||
}
|
||||
}
|
||||
else if ( start_cpu != ~0U )
|
||||
{
|
||||
if ( j - 1 != start_cpu )
|
||||
printk("-%d ", j - 1);
|
||||
else
|
||||
printk(" ");
|
||||
start_cpu = ~0U;
|
||||
}
|
||||
}
|
||||
|
||||
if ( start_cpu != ~0U && start_cpu != j - 1 )
|
||||
printk("-%d", j - 1);
|
||||
|
||||
printk("\n");
|
||||
|
||||
for ( j = 0; j < vnuma->nr_vmemranges; j++ )
|
||||
{
|
||||
if ( vnuma->vmemrange[j].nid == i )
|
||||
printk(" %016"PRIx64" - %016"PRIx64"\n",
|
||||
vnuma->vmemrange[j].start,
|
||||
vnuma->vmemrange[j].end);
|
||||
}
|
||||
}
|
||||
|
||||
read_unlock(&d->vnuma_rwlock);
|
||||
}
|
||||
|
||||
rcu_read_unlock(&domlist_read_lock);
|
||||
|
||||