]> xenbits.xensource.com Git - xen.git/commitdiff
honor MEMF_no_refcount in alloc_heap_pages()
authorJan Beulich <jbeulich@suse.com>
Thu, 26 Feb 2015 12:58:54 +0000 (13:58 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 26 Feb 2015 12:58:54 +0000 (13:58 +0100)
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.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/common/page_alloc.c

index 3c27af96ea786e6afe1d02a1738695749f653075..a7bdbfd956464d1192f16bfeb17bd252be97ac3d 100644 (file)
@@ -617,7 +617,8 @@ static struct page_info *alloc_heap_pages(
      */
     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;
 
     /*