diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-08-05 09:28:24 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-08-05 09:28:24 +0100 |
commit | 2765f0bf9f8c65ce43c5e8cfc4d08cd32b90180d (patch) | |
tree | f5b3cce4ba2b4966a143e67160c964101fd4a9fa /xen/arch/x86/numa.c | |
parent | 37adc8f09afa8f48bdaa10b38856193f456f67ad (diff) |
x86: debug key prints memory node info of each domain
This patch will collect memory location (the domain has how many pages
in different node) of each domain and display if you input debug key.
Signed-off-by: Zhou Ting <ting.g.zhou@intel.com>
Diffstat (limited to 'xen/arch/x86/numa.c')
-rw-r--r-- | xen/arch/x86/numa.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index ab3050b3e6..0debd987bc 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -14,6 +14,7 @@ #include <xen/time.h> #include <xen/smp.h> #include <asm/acpi.h> +#include <xen/sched.h> static int numa_setup(char *s); custom_param("numa", numa_setup); @@ -281,6 +282,9 @@ static void dump_numa(unsigned char key) { s_time_t now = NOW(); int i; + struct domain *d; + struct page_info *page; + unsigned int page_num_node[MAX_NUMNODES]; printk("'%c' pressed -> dumping numa info (now-0x%X:%08X)\n", key, (u32)(now>>32), (u32)now); @@ -297,6 +301,28 @@ static void dump_numa(unsigned char key) } for_each_online_cpu(i) printk("CPU%d -> NODE%d\n", i, cpu_to_node[i]); + + rcu_read_lock(&domlist_read_lock); + + printk("Memory location of each domain:\n"); + for_each_domain(d) + { + printk("Domain %u (total: %u):\n", d->domain_id, d->tot_pages); + + for_each_online_node(i) + page_num_node[i] = 0; + + list_for_each_entry(page, &d->page_list, list) + { + i = phys_to_nid(page_to_mfn(page) << PAGE_SHIFT); + page_num_node[i]++; + } + + for_each_online_node(i) + printk(" Node %u: %u\n", i, page_num_node[i]); + } + + rcu_read_unlock(&domlist_read_lock); } static __init int register_numa_trigger(void) |