Subject: Re: CVS commit: src/sys/arch/xen
To: YAMAMOTO Takashi <>
From: Manuel Bouyer <>
List: source-changes
Date: 08/22/2005 13:03:09
On Mon, Aug 22, 2005 at 07:50:28AM +0900, YAMAMOTO Takashi wrote:
> > - implement _xen_bus_dmamem_alloc_range(), which will request a contigous
> >   set of pages to the hypervisor if the pages returned by uvm_pglistalloc()
> >   don't fit the constraints.
> - it seems to leak memory in the case of EINVAL.

Right, I added a uvm_pglistfree() here. Thanks.

> - there is no recovery in the case of failure of MEMOP_increase_reservation.
>   is this intended?

There's no recovery needed. We lost these pages, they are marked as
allocated in UVM so that's OK. We could eventually reallocate the pages one by
one, but I'm not sure it's worth it as it's not something that should
happen anyway.

>   i think it's better to do MEMOP_decrease_reservation
>   only when MEMOP_increase_reservation succeeded.
>   MEMOP_decrease_reservation unlikely helps MEMOP_increase_reservation
>   anyway.

MEMOP_increase_reservation won't work if we didn't give enouth page
back first, because the hypervisor won't allow a domain to increase
its number of pages past the configured limit (and a domain starts with
this number of pages allocated).

Manuel Bouyer <>
     NetBSD: 26 ans d'experience feront toujours la difference