ia64/xen-unstable

changeset 10178:79d74ce206bb

[BALLOON] Do not allow target to be set below two percent of maximum
memory size.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu May 25 14:54:43 2006 +0100 (2006-05-25)
parents 1449c0f57b9d
children 41de9cd7971b
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	Thu May 25 14:47:23 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Thu May 25 14:54:43 2006 +0100
     1.3 @@ -360,6 +360,12 @@ static void balloon_process(void *unused
     1.4  /* Resets the Xen limit, sets new target, and kicks off processing. */
     1.5  static void set_new_target(unsigned long target)
     1.6  {
     1.7 +	unsigned long min_target;
     1.8 +
     1.9 +	/* Do not allow target to reduce below 2% of maximum memory size. */
    1.10 +	min_target = max_pfn / 50;
    1.11 +	target = max(target, min_target);
    1.12 +
    1.13  	/* No need for lock. Not read-modify-write updates. */
    1.14  	hard_limit   = ~0UL;
    1.15  	target_pages = target;