ia64/xen-unstable

changeset 7516:e47f04c55eb1

compute the correct totalram_pages when the balloon increase or decrease the
reservation. memory reports should be more correct now.

From: Satoshi Uchida <s-uchida@ap.jp.nec.com>
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author vhanquez@kneesa.uk.xensource.com
date Mon Oct 24 12:57:37 2005 +0100 (2005-10-24)
parents 98c6c36ac444
children f0e92f206c8a
files linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Mon Oct 24 14:12:42 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Mon Oct 24 12:57:37 2005 +0100
     1.3 @@ -70,6 +70,9 @@ spinlock_t balloon_lock = SPIN_LOCK_UNLO
     1.4  static unsigned long current_pages;
     1.5  static unsigned long target_pages;
     1.6  
     1.7 +/* VM /proc information for memory */
     1.8 +extern unsigned long totalram_pages;
     1.9 +
    1.10  /* We may hit the hard limit in Xen. If we do then we remember it. */
    1.11  static unsigned long hard_limit;
    1.12  
    1.13 @@ -223,6 +226,7 @@ static int increase_reservation(unsigned
    1.14  	}
    1.15  
    1.16  	current_pages += nr_pages;
    1.17 +	totalram_pages = current_pages;
    1.18  
    1.19   out:
    1.20  	balloon_unlock(flags);
    1.21 @@ -295,6 +299,7 @@ static int decrease_reservation(unsigned
    1.22  		XENMEM_decrease_reservation, &reservation) != nr_pages);
    1.23  
    1.24  	current_pages -= nr_pages;
    1.25 +	totalram_pages = current_pages;
    1.26  
    1.27  	balloon_unlock(flags);
    1.28