diff -r 8f81bdd57afe xen/arch/x86/mm/p2m.c --- a/xen/arch/x86/mm/p2m.c Thu Sep 03 09:51:37 2009 +0100 +++ b/xen/arch/x86/mm/p2m.c Thu Sep 03 16:36:42 2009 +0100 @@ -634,7 +634,7 @@ p2md->pod.entry_count-=(1<pod.entry_count < 0); ret = 1; - goto out_unlock; + goto out_entry_check; } /* FIXME: Steal contig 2-meg regions for cache */ @@ -678,6 +678,12 @@ } } + /* If there are no more non-PoD entries, tell decrease_reservation() that + * there's nothing left to do. */ + if ( nonpod == 0 ) + ret = 1; + +out_entry_check: /* If we've reduced our "liabilities" beyond our "assets", free some */ if ( p2md->pod.entry_count < p2md->pod.count ) { @@ -685,11 +691,6 @@ p2m_pod_set_cache_target(d, p2md->pod.entry_count); } - /* If there are no more non-PoD entries, tell decrease_reservation() that - * there's nothing left to do. */ - if ( nonpod == 0 ) - ret = 1; - out_unlock: audit_p2m(d); p2m_unlock(p2md);