--- a/xen/arch/x86/mm/hap/hap.c +++ b/xen/arch/x86/mm/hap/hap.c @@ -273,16 +273,21 @@ static struct page_info *hap_alloc_p2m_p if ( likely(pg != NULL) ) { +static unsigned thr;//temp d->arch.paging.hap.total_pages--; d->arch.paging.hap.p2m_pages++; +if(d->arch.paging.hap.p2m_pages > thr) {//temp + thr |= d->arch.paging.hap.p2m_pages; + printk("d%d: p2m=%x (%x/%x)\n", d->domain_id, d->arch.paging.hap.p2m_pages, d->arch.paging.hap.free_pages, d->arch.paging.hap.total_pages); +} page_set_owner(pg, d); pg->count_info |= 1; } else if ( !d->arch.paging.p2m_alloc_failed ) { d->arch.paging.p2m_alloc_failed = 1; - dprintk(XENLOG_ERR, "d%i failed to allocate from HAP pool", - d->domain_id); + dprintk(XENLOG_ERR, "d%i failed to allocate from HAP pool (free=%x tot=%x p2m=%x)\n", + d->domain_id, d->arch.paging.hap.free_pages, d->arch.paging.hap.total_pages, d->arch.paging.hap.p2m_pages); } paging_unlock(d); @@ -330,9 +335,17 @@ static unsigned int hap_set_allocation(struct domain *d, unsigned int pages, int *preempted) { struct page_info *pg; +static domid_t logdom;//temp +static unsigned logpg;//temp ASSERT(paging_locked_by_me(d)); +if(d->domain_id != logdom || pages != logpg) {//temp + logdom = d->domain_id; + logpg = pages; + printk("hsa(d%d,%x) tot=%x p2m=%x free=%x [%pS]\n", d->domain_id, pages, d->arch.paging.hap.total_pages, + d->arch.paging.hap.p2m_pages, d->arch.paging.hap.free_pages, __builtin_return_address(0)); +} if ( pages < d->arch.paging.hap.p2m_pages ) pages = 0; else @@ -378,6 +391,8 @@ hap_set_allocation(struct domain *d, uns } } +printk("hsa(d%d,%x) tot=%x p2m=%x free=%x\n", d->domain_id, pages, d->arch.paging.hap.total_pages,//temp + d->arch.paging.hap.p2m_pages, d->arch.paging.hap.free_pages); return 0; }