Skip to contentSkip to conversation

tmem: fix freeable memory accounting error

PATCH New Dan Magenheimer 1 participant 1 message Nov 23, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tmem: fix freeable memory accounting error

Fix tmem accounting error that causes an "apparent" memory leak, creating false negatives when testing memory availability for launching a new domain.

xen/include/xen/tmem_xen.h +1 -1
diff -r 5bfc7e343207 xen/include/xen/tmem_xen.h
@@ -229,7 +229,7 @@ static inline struct page_info *tmh_allo
     if ( pi == NULL && !no_heap )
         pi = alloc_domheap_pages(0,0,MEMF_tmem);
     ASSERT((pi == NULL) || IS_VALID_PAGE(pi));
-    if ( pi != NULL )
+    if ( pi != NULL && !no_heap )
         atomic_inc(&freeable_page_count);
     return pi;
 }
xen/include/xen/tmem_xen.h +1 -1
diff -r 5bfc7e343207 xen/include/xen/tmem_xen.h
@@ -229,7 +229,7 @@ static inline struct page_info *tmh_allo
     if ( pi == NULL && !no_heap )
         pi = alloc_domheap_pages(0,0,MEMF_tmem);
     ASSERT((pi == NULL) || IS_VALID_PAGE(pi));
-    if ( pi != NULL )
+    if ( pi != NULL && !no_heap )
         atomic_inc(&freeable_page_count);
     return pi;
 }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel