direct-io.hg

changeset 14273:87f626f1d5f5

A correct fix for page_alloc crash when Xen heap empty.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Mar 07 09:43:36 2007 +0000 (2007-03-07)
parents 095a476a96b1
children 228c3e05eb00
files xen/common/page_alloc.c
line diff
     1.1 --- a/xen/common/page_alloc.c	Tue Mar 06 16:51:42 2007 +0000
     1.2 +++ b/xen/common/page_alloc.c	Wed Mar 07 09:43:36 2007 +0000
     1.3 @@ -342,7 +342,8 @@ static struct page_info *alloc_heap_page
     1.4      unsigned int zone_lo, unsigned zone_hi,
     1.5      unsigned int cpu, unsigned int order)
     1.6  {
     1.7 -    int i, j, zone, node = cpu_to_node(cpu), num_nodes = num_online_nodes();
     1.8 +    unsigned int i, j, zone;
     1.9 +    unsigned int node = cpu_to_node(cpu), num_nodes = num_online_nodes();
    1.10      unsigned long request = 1UL << order;
    1.11      struct page_info *pg;
    1.12  
    1.13 @@ -362,7 +363,7 @@ static struct page_info *alloc_heap_page
    1.14       * needless computation on fast-path */
    1.15      for ( i = 0; i < num_nodes; i++ )
    1.16      {
    1.17 -        for ( zone = zone_hi; zone >= zone_lo; --zone )
    1.18 +        for ( zone = zone_hi; zone-- > zone_lo; )
    1.19          {
    1.20              /* check if target node can support the allocation */
    1.21              if ( avail[node] && (avail[node][zone] >= request) )