Skip to contentSkip to conversation

honor MEMF_no_refcount in alloc_heap_pages()

PATCH In review Jan Beulich 2 participants 2 messages Feb 25, 2015 – Feb 26, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 honor MEMF_no_refcount in alloc_heap_pages()

Non-anonymous allocations with this flag set should - for the purpose of the availability check - be treated just like anonymous ones, as they wouldn't lead to a reduction of ->outstanding_pages.

xen/common/page_alloc.c +2 -1
@@ -617,7 +617,8 @@ static struct page_info *alloc_heap_page
      */
     if ( (outstanding_claims + request >
           total_avail_pages + tmem_freeable_pages()) &&
-          (d == NULL || d->outstanding_pages < request) )
+          ((memflags & MEMF_no_refcount) ||
+           !d || d->outstanding_pages < request) )
         goto not_found;
 
     /*

honor MEMF_no_refcount in alloc_heap_pages()

Non-anonymous allocations with this flag set should - for the purpose of the availability check - be treated just like anonymous ones, as they wouldn't lead to a reduction of ->outstanding_pages.

xen/common/page_alloc.c +2 -1
@@ -617,7 +617,8 @@ static struct page_info *alloc_heap_page
      */
     if ( (outstanding_claims + request >
           total_avail_pages + tmem_freeable_pages()) &&
-          (d == NULL || d->outstanding_pages < request) )
+          ((memflags & MEMF_no_refcount) ||
+           !d || d->outstanding_pages < request) )
         goto not_found;
 
     /*

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

Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jan Beulich

Non-anonymous allocations with this flag set should - for the purpose of the availability check - be treated just like anonymous ones, as they wouldn't lead to a reduction of ->outstanding_pages.

Quoted 13 lines
xen/common/page_alloc.c +2 -1
@@ -617,7 +617,8 @@ static struct page_info *alloc_heap_page
      */
     if ( (outstanding_claims + request >
           total_avail_pages + tmem_freeable_pages()) &&
-          (d == NULL || d->outstanding_pages < request) )
+          ((memflags & MEMF_no_refcount) ||
+           !d || d->outstanding_pages < request) )
         goto not_found;
 
     /*