WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Problem re-alloc'ing after freeing domheap pages

To: "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Problem re-alloc'ing after freeing domheap pages
From: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Date: Thu, 13 Nov 2008 22:32:05 +0000 (GMT)
Delivery-date: Thu, 13 Nov 2008 14:33:20 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
I am trying (in Xen) to repeatedly allocate and free
domheap pages belonging to a pv domain.  However,
once a page is freed, it doesn't seem to be
allocatable again.  In pseudo-code:

free_up_some_pages_using_ballooning()
count = 0;
while (1) {
  if ((p = alloc_domheap_pages(d,0,0)) == NULL)
    break;
  /* save p someplace */
  count++;
}
for all saved p's {
  free_domheap_pages(p,0);
}
while (count--) {
  if ((p = alloc_domheap_pages(d,0,0)) == NULL)
    FAIL!!
}

This fails for all alloc's in the second while loop.

Is there something else I need to do when I allocate
or free a non-anonymous domheap page?  (Note this seems
to work fine for anonymous domheap pages.)

Do I maybe need to also do list_del(&p->list)?  Or
get_page()/put_page() or something like that?

Thanks,
Dan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>