ia64/xen-unstable

changeset 56:fe3bada5b25b

bitkeeper revision 1.12 (3e00b95a3fK0b9XF_UVth6TivqeezA)

fix silly large mem request => panic death bug
author smh22@uridium.cl.cam.ac.uk
date Wed Dec 18 18:07:22 2002 +0000 (2002-12-18)
parents 8ce741992076
children af2f305e6020
files .bk-to-hg .hg-to-bk .rootkeys xen-2.4.16/common/page_alloc.c
line diff
     1.1 --- a/.bk-to-hg	Wed Dec 18 13:20:01 2002 +0000
     1.2 +++ b/.bk-to-hg	Wed Dec 18 18:07:22 2002 +0000
     1.3 @@ -1,6 +1,6 @@
     1.4  #!/bin/sh -x
     1.5  set -e
     1.6 -test -L foo
     1.7 -rm      foo
     1.8 +test -L xenolinux-2.4.16-sparse/include/asm-xeno/hypervisor-ifs
     1.9 +rm      xenolinux-2.4.16-sparse/include/asm-xeno/hypervisor-ifs
    1.10  (find -depth -type d -print | xargs -r rmdir 2>/dev/null) || true
    1.11  exit 0
     2.1 --- a/.hg-to-bk	Wed Dec 18 13:20:01 2002 +0000
     2.2 +++ b/.hg-to-bk	Wed Dec 18 18:07:22 2002 +0000
     2.3 @@ -1,5 +1,8 @@
     2.4  #!/bin/sh -x
     2.5  set -e
     2.6 -ln -s ../../../xen-2.4.16/include/hypervisor-ifs/ foo
     2.7 +mkdir -p xenolinux-2.4.16-sparse
     2.8 +mkdir -p xenolinux-2.4.16-sparse/include
     2.9 +mkdir -p xenolinux-2.4.16-sparse/include/asm-xeno
    2.10 +ln -s ../../../xen-2.4.16/include/hypervisor-ifs xenolinux-2.4.16-sparse/include/asm-xeno/hypervisor-ifs
    2.11  (find -depth -type d -print | xargs -r rmdir 2>/dev/null) || true
    2.12  exit 0
     3.1 --- a/.rootkeys	Wed Dec 18 13:20:01 2002 +0000
     3.2 +++ b/.rootkeys	Wed Dec 18 18:07:22 2002 +0000
     3.3 @@ -1,7 +1,6 @@
     3.4  3ddb6b0bKlMz_dz-M59a1mkUa1lASw BitKeeper/etc/config
     3.5  3ddb6b0buTaC5zg1_a8FoAR9FWi_mw BitKeeper/etc/ignore
     3.6  3ddb79c9_hgSp-gsQm8HqWM_9W3B_A BitKeeper/etc/logging_ok
     3.7 -3deb3f5bhXnxocVMiXaeZ0L7fQBGaw foo
     3.8  3ddb79bcbOVHh38VJzc97-JEGD4dJQ xen-2.4.16/Makefile
     3.9  3ddb79bcCa2VbsMp7mWKlhgwLQUQGA xen-2.4.16/README
    3.10  3ddb79bcWnTwYsQRWl_PaneJfa6p0w xen-2.4.16/Rules.mk
    3.11 @@ -318,6 +317,7 @@ 3ddb79bas-nFywnmilbUeT34PEAA0g xenolinux
    3.12  3ddb79batzR40ZFY9dvgs5f1aM9I6g xenolinux-2.4.16-sparse/include/asm-xeno/hdreg.h
    3.13  3ddb79b90xBgbeYgCcImS2ZxJakxBA xenolinux-2.4.16-sparse/include/asm-xeno/highmem.h
    3.14  3ddb79baXLZV3dUKQI2gIYpAy67RuA xenolinux-2.4.16-sparse/include/asm-xeno/hw_irq.h
    3.15 +3e00b957iYsdTI1x6THRwMoWSPIW2Q xenolinux-2.4.16-sparse/include/asm-xeno/hypervisor-ifs
    3.16  3ddb79bapQ9Z9ewa5O1pqAVaNBTazg xenolinux-2.4.16-sparse/include/asm-xeno/hypervisor.h
    3.17  3ddb79baL-pjPI8hg5xjPgd4__SlOA xenolinux-2.4.16-sparse/include/asm-xeno/i387.h
    3.18  3ddb79ba66TwvG7HpbBo04fRhmj3KQ xenolinux-2.4.16-sparse/include/asm-xeno/ide.h
     4.1 --- a/xen-2.4.16/common/page_alloc.c	Wed Dec 18 13:20:01 2002 +0000
     4.2 +++ b/xen-2.4.16/common/page_alloc.c	Wed Dec 18 18:07:22 2002 +0000
     4.3 @@ -178,13 +178,19 @@ unsigned long __get_free_pages(int mask,
     4.4  
     4.5      spin_lock_irqsave(&alloc_lock, flags);
     4.6  
     4.7 -    /* Found smallest order which can satisfy the request. */
     4.8 -    for ( i = order; FREELIST_EMPTY(free_list[i]); i++ ) 
     4.9 -    {
    4.10 -        if ( i == FREELIST_SIZE ) 
    4.11 -            panic("Out of memory!\n");
    4.12 +
    4.13 +    /* Find smallest order which can satisfy the request. */
    4.14 +    for ( i = order; i < FREELIST_SIZE; i++ ) {
    4.15 +	if ( !FREELIST_EMPTY(free_list[i]) ) 
    4.16 +	    break;
    4.17      }
    4.18  
    4.19 +    if ( i == FREELIST_SIZE )
    4.20 +    {
    4.21 +        printk("Cannot handle page request order %d!\n", order);
    4.22 +	return NULL; 
    4.23 +    }
    4.24 + 
    4.25      /* Unlink a chunk. */
    4.26      alloc_ch = free_list[i];
    4.27      free_list[i] = alloc_ch->next;