From: Daniel Stodden Subject: free_domheap_pages() leaking xenheap pages? Date: Tue, 23 Jan 2007 17:25:02 +0100 Message-ID: <1169569502.29569.23.camel@lapbode42.lrr.in.tum.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0289012474==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen Developers List-Id: xen-devel@lists.xenproject.org --===============0289012474== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-8/6Skxp5M0jfrAuRrF80" --=-8/6Skxp5M0jfrAuRrF80 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable hi. maybe someone can help me out with the xenheap page allocator in combination with shared pages? the following is from page_alloc.c: void free_domheap_pages(struct page_info *pg, unsigned int order) { int i, drop_dom_ref; struct domain *d =3D page_get_owner(pg); ASSERT(!in_irq()); if ( unlikely(IS_XEN_HEAP_FRAME(pg)) ) { /* NB. May recursively lock from relinquish_memory(). */ spin_lock_recursive(&d->page_alloc_lock); for ( i =3D 0; i < (1 << order); i++ ) list_del(&pg[i].list); d->xenheap_pages -=3D 1 << order; drop_dom_ref =3D (d->xenheap_pages =3D=3D 0); spin_unlock_recursive(&d->page_alloc_lock); [XXX] } else [..] i would have expected something ultimately turning into a free_heap_pages( MEMZONE_XEN, pg, order ) to occur at point [XXX]. the page range remains unlisted upon return, and if there's any later point in the domain life cycle where these pages would ever return to the xen heap, i'm unable to find it. background: i'm writing code supposed to communicate with dom0 via a number of shared pages. pseudocode: =20 my_init( something ) { something->pg =3D alloc_xenheap_page(); share_xen_page_with_privileged_guests( virt_to_page(pg), ... ); } my_uninit( something ) { put_page_and_type( something->pg ); } is the latter put_page_and_type() correct? i'm asking because it seems obvious, while xenoprof appears to do similar things with xen_heap, but in a much stranger fashion when it comes to freeing those pages. regards, daniel --=20 Daniel Stodden LRR - Lehrstuhl f=C3=BCr Rechnertechnik und Rechnerorganisation Institut f=C3=BCr Informatik der TU M=C3=BCnchen D-85748 Garchi= ng http://www.lrr.in.tum.de/~stodden mailto:stodden@cs.tum.edu PGP Fingerprint: F5A4 1575 4C56 E26A 0B33 3D80 457E 82AE B0D8 735B --=-8/6Skxp5M0jfrAuRrF80 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQBFtjbeRX6CrrDYc1sRAtZlAJ9DFkKZ12PpQu3IaJ1Y9+pE3L281ACeK9Re q0GH3c2eHFf+FXNI6Dw9oVg= =wYwg -----END PGP SIGNATURE----- --=-8/6Skxp5M0jfrAuRrF80-- --===============0289012474== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0289012474==--