All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tmem: fix freeable memory accounting error
@ 2009-11-23 19:42 Dan Magenheimer
  0 siblings, 0 replies; only message in thread
From: Dan Magenheimer @ 2009-11-23 19:42 UTC (permalink / raw)
  To: Xen-Devel (E-mail)

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

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 <dan.magenheimer@oracle.com>

diff -r 5bfc7e343207 xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Mon Nov 23 11:08:51 2009 -0700
+++ b/xen/include/xen/tmem_xen.h	Mon Nov 23 12:39:37 2009 -0700
@@ -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;
 }

[-- Attachment #2: tmem-freeable.patch --]
[-- Type: application/octet-stream, Size: 490 bytes --]

diff -r 5bfc7e343207 xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h	Mon Nov 23 11:08:51 2009 -0700
+++ b/xen/include/xen/tmem_xen.h	Mon Nov 23 12:39:37 2009 -0700
@@ -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;
 }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-23 19:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-23 19:42 [PATCH] tmem: fix freeable memory accounting error Dan Magenheimer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.