debuggers.hg

changeset 21001:077089e37ac9

tmem: When failing allocs from "midsize alloc zone", try the tmem
pools rather than fail outright.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Feb 17 15:54:40 2010 +0000 (2010-02-17)
parents b4041e7bbe1b
children a591bf0a9dd6
files xen/common/page_alloc.c
line diff
     1.1 --- a/xen/common/page_alloc.c	Wed Feb 17 12:11:13 2010 +0000
     1.2 +++ b/xen/common/page_alloc.c	Wed Feb 17 15:54:40 2010 +0000
     1.3 @@ -309,11 +309,11 @@ static struct page_info *alloc_heap_page
     1.4  
     1.5      /*
     1.6       * TMEM: When available memory is scarce, allow only mid-size allocations
     1.7 -     * to avoid worst of fragmentation issues.
     1.8 +     * to avoid worst of fragmentation issues. Others try TMEM pools then fail.
     1.9       */
    1.10      if ( opt_tmem && ((order == 0) || (order >= 9)) &&
    1.11           (total_avail_pages <= midsize_alloc_zone_pages) )
    1.12 -        goto fail;
    1.13 +        goto try_tmem;
    1.14  
    1.15      /*
    1.16       * Start with requested node, but exhaust all node memory in requested 
    1.17 @@ -340,6 +340,7 @@ static struct page_info *alloc_heap_page
    1.18              node = first_node(node_online_map);
    1.19      }
    1.20  
    1.21 + try_tmem:
    1.22      /* Try to free memory from tmem */
    1.23      if ( (pg = tmem_relinquish_pages(order,memflags)) != NULL )
    1.24      {
    1.25 @@ -348,7 +349,6 @@ static struct page_info *alloc_heap_page
    1.26          return pg;
    1.27      }
    1.28  
    1.29 - fail:
    1.30      /* No suitable memory blocks. Fail the request. */
    1.31      spin_unlock(&heap_lock);
    1.32      return NULL;