All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] set maxmem bugfix
@ 2005-07-15  8:13 aq
  2005-07-15  8:31 ` Keir Fraser
  0 siblings, 1 reply; 3+ messages in thread
From: aq @ 2005-07-15  8:13 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

Recently some people complain that they cannot set the maxmem for
domU. The problem is that some code wrongly treat dom.max_memkb as in
byte unit, instead of KB unit. This patch fixs the problem.

Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>


$ diffstat maxmem.patch 
 xc_domain.c     |    2 +-
 xc_linux_save.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

[-- Attachment #2: maxmem.patch --]
[-- Type: application/octet-stream, Size: 996 bytes --]

diff -r 1d026c7023d2 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Thu Jul 14 23:48:06 2005
+++ b/tools/libxc/xc_domain.c	Fri Jul 15 17:07:29 2005
@@ -107,7 +107,7 @@
 
         info->ssidref  = op.u.getdomaininfo.ssidref;
         info->nr_pages = op.u.getdomaininfo.tot_pages;
-        info->max_memkb = op.u.getdomaininfo.max_pages<<(PAGE_SHIFT);
+        info->max_memkb = op.u.getdomaininfo.max_pages<<(PAGE_SHIFT - 10);
         info->shared_info_frame = op.u.getdomaininfo.shared_info_frame;
         info->cpu_time = op.u.getdomaininfo.cpu_time;
         info->vcpus = op.u.getdomaininfo.n_vcpu;
diff -r 1d026c7023d2 tools/libxc/xc_linux_save.c
--- a/tools/libxc/xc_linux_save.c	Thu Jul 14 23:48:06 2005
+++ b/tools/libxc/xc_linux_save.c	Fri Jul 15 17:07:29 2005
@@ -464,7 +464,7 @@
         goto out;
     }
     
-    nr_pfns = info.max_memkb >> PAGE_SHIFT; 
+    nr_pfns = info.max_memkb >> (PAGE_SHIFT - 10); 
 
     /* cheesy sanity check */
     if ( nr_pfns > 1024*1024 ){

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] set maxmem bugfix
  2005-07-15  8:31 ` Keir Fraser
@ 2005-07-15  8:31   ` aq
  0 siblings, 0 replies; 3+ messages in thread
From: aq @ 2005-07-15  8:31 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

On 7/15/05, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:
> 
> On 15 Jul 2005, at 09:13, aq wrote:
> 
> > Recently some people complain that they cannot set the maxmem for
> > domU. The problem is that some code wrongly treat dom.max_memkb as in
> > byte unit, instead of KB unit. This patch fixs the problem.
> >
> > Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
> 
> The patch fixes a bug, but I doubt it fixes the 'xm balloon' problem.
> Did you test that before and after applying your patch?

actually no, i havent looked at the balloon problem yet. will do it soon.

regards,
aq

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] set maxmem bugfix
  2005-07-15  8:13 [PATCH] set maxmem bugfix aq
@ 2005-07-15  8:31 ` Keir Fraser
  2005-07-15  8:31   ` aq
  0 siblings, 1 reply; 3+ messages in thread
From: Keir Fraser @ 2005-07-15  8:31 UTC (permalink / raw)
  To: aq; +Cc: xen-devel


On 15 Jul 2005, at 09:13, aq wrote:

> Recently some people complain that they cannot set the maxmem for
> domU. The problem is that some code wrongly treat dom.max_memkb as in
> byte unit, instead of KB unit. This patch fixs the problem.
>
> Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>

The patch fixes a bug, but I doubt it fixes the 'xm balloon' problem. 
Did you test that before and after applying your patch?

  -- Keir

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-07-15  8:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-15  8:13 [PATCH] set maxmem bugfix aq
2005-07-15  8:31 ` Keir Fraser
2005-07-15  8:31   ` aq

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.