]> xenbits.xensource.com Git - xen.git/commitdiff
tmem: When failing allocs from "midsize alloc zone", try the tmem
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 17 Feb 2010 15:54:40 +0000 (15:54 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 17 Feb 2010 15:54:40 +0000 (15:54 +0000)
pools rather than fail outright.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/common/page_alloc.c

index 54920ff4db4537e211b2ae00dcb03dc3ee015449..26a0ee9ba1e4fb4ba1f9cca807d4f92b616b60fd 100644 (file)
@@ -309,11 +309,11 @@ static struct page_info *alloc_heap_pages(
 
     /*
      * TMEM: When available memory is scarce, allow only mid-size allocations
-     * to avoid worst of fragmentation issues.
+     * to avoid worst of fragmentation issues. Others try TMEM pools then fail.
      */
     if ( opt_tmem && ((order == 0) || (order >= 9)) &&
          (total_avail_pages <= midsize_alloc_zone_pages) )
-        goto fail;
+        goto try_tmem;
 
     /*
      * Start with requested node, but exhaust all node memory in requested 
@@ -340,6 +340,7 @@ static struct page_info *alloc_heap_pages(
             node = first_node(node_online_map);
     }
 
+ try_tmem:
     /* Try to free memory from tmem */
     if ( (pg = tmem_relinquish_pages(order,memflags)) != NULL )
     {
@@ -348,7 +349,6 @@ static struct page_info *alloc_heap_pages(
         return pg;
     }
 
- fail:
     /* No suitable memory blocks. Fail the request. */
     spin_unlock(&heap_lock);
     return NULL;