From: Dan Magenheimer Subject: [PATCH] tmem: fix freeable memory accounting error Date: Mon, 23 Nov 2009 11:42:33 -0800 (PST) Message-ID: <0a07f79e-039c-4fcb-bdd1-398d30938afd@default> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="__12590053792552777abhmt016.oracle.com" 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 --__12590053792552777abhmt016.oracle.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Fix tmem accounting error that causes an "apparent" memory leak, creating false negatives when testing memory availability for launching a new domain. Signed-off-by: Dan Magenheimer diff -r 5bfc7e343207 xen/include/xen/tmem_xen.h --- a/xen/include/xen/tmem_xen.h=09Mon Nov 23 11:08:51 2009 -0700 +++ b/xen/include/xen/tmem_xen.h=09Mon Nov 23 12:39:37 2009 -0700 @@ -229,7 +229,7 @@ static inline struct page_info *tmh_allo if ( pi =3D=3D NULL && !no_heap ) pi =3D alloc_domheap_pages(0,0,MEMF_tmem); ASSERT((pi =3D=3D NULL) || IS_VALID_PAGE(pi)); - if ( pi !=3D NULL ) + if ( pi !=3D NULL && !no_heap ) atomic_inc(&freeable_page_count); return pi; } --__12590053792552777abhmt016.oracle.com Content-Type: application/octet-stream; name="tmem-freeable.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="tmem-freeable.patch" ZGlmZiAtciA1YmZjN2UzNDMyMDcgeGVuL2luY2x1ZGUveGVuL3RtZW1feGVuLmgKLS0tIGEveGVu L2luY2x1ZGUveGVuL3RtZW1feGVuLmgJTW9uIE5vdiAyMyAxMTowODo1MSAyMDA5IC0wNzAwCisr KyBiL3hlbi9pbmNsdWRlL3hlbi90bWVtX3hlbi5oCU1vbiBOb3YgMjMgMTI6Mzk6MzcgMjAwOSAt MDcwMApAQCAtMjI5LDcgKzIyOSw3IEBAIHN0YXRpYyBpbmxpbmUgc3RydWN0IHBhZ2VfaW5mbyAq dG1oX2FsbG8KICAgICBpZiAoIHBpID09IE5VTEwgJiYgIW5vX2hlYXAgKQogICAgICAgICBwaSA9 IGFsbG9jX2RvbWhlYXBfcGFnZXMoMCwwLE1FTUZfdG1lbSk7CiAgICAgQVNTRVJUKChwaSA9PSBO VUxMKSB8fCBJU19WQUxJRF9QQUdFKHBpKSk7Ci0gICAgaWYgKCBwaSAhPSBOVUxMICkKKyAgICBp ZiAoIHBpICE9IE5VTEwgJiYgIW5vX2hlYXAgKQogICAgICAgICBhdG9taWNfaW5jKCZmcmVlYWJs ZV9wYWdlX2NvdW50KTsKICAgICByZXR1cm4gcGk7CiB9Cg== --__12590053792552777abhmt016.oracle.com 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 --__12590053792552777abhmt016.oracle.com--