From: Dan Magenheimer Subject: Problem re-alloc'ing after freeing domheap pages Date: Thu, 13 Nov 2008 22:32:05 +0000 (GMT) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Xen-Devel (E-mail)" List-Id: xen-devel@lists.xenproject.org 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 =3D 0; while (1) { if ((p =3D alloc_domheap_pages(d,0,0)) =3D=3D NULL) break; /* save p someplace */ count++; } for all saved p's { free_domheap_pages(p,0); } while (count--) { if ((p =3D alloc_domheap_pages(d,0,0)) =3D=3D 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