|
|
|
|
|
|
|
|
|
|
xen-devel
RE: [Xen-devel] [PATCH] linux/balloon: don't allow ballooning down a dom
I see. Sorry I missed this in the earlier thread. I can
confirm that the patch below works in a module.
Keir, the existing checked in balloon.c doesn't work properly
when compiled as a module so Jan's patch should be applied.
> -----Original Message-----
> From: Jan Beulich [mailto:jbeulich@xxxxxxxxxx]
> Sent: Tuesday, May 13, 2008 1:08 AM
> To: dan.magenheimer@xxxxxxxxxx
> Cc: keir.fraser@xxxxxxxxxxxxx; xen-devel@xxxxxxxxxxxxxxxxxxx; Ky
> Srinivasan; garloff@xxxxxxx
> Subject: RE: [Xen-devel] [PATCH] linux/balloon: don't allow ballooning
> down a domain below a reasonable limit
>
>
> >>> "Dan Magenheimer" <dan.magenheimer@xxxxxxxxxx> 09.05.08 22:38 >>>
> >Hmmm... it appears to me that minimum_target() doesn't
> >work when balloon.c is built as a module (always returns 0).
> >
> >Can you confirm/deny?
>
> Yes, that's a change Keir did after noticing that I used an improper
> variable (totalram_pages) to base the calculation upon in the
> modular case
> (max_pfn is not exported anymore in newer kernels). It should
> be possible
> though to base the calculation on num_physpages, as in the
> patch below.
>
> Jan
>
> --- head-2008-04-15.orig/drivers/xen/balloon/balloon.c
> +++ head-2008-04-15/drivers/xen/balloon/balloon.c
> @@ -198,8 +198,8 @@ static unsigned long current_target(void
> static unsigned long minimum_target(void)
> {
> #ifndef CONFIG_XEN
> - return 0;
> -#else
> +#define max_pfn num_physpages
> +#endif
> unsigned long min_pages, curr_pages = current_target();
>
> #define MB2PAGES(mb) ((mb) << (20 - PAGE_SHIFT))
> @@ -227,7 +227,7 @@ static unsigned long minimum_target(void
>
> /* Don't enforce growth */
> return min(min_pages, curr_pages);
> -#endif
> +#undef max_pfn
> }
>
> static int increase_reservation(unsigned long nr_pages)
>
>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|