All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]xl: make mem-set and mem-max to use MB for memory unit by default.
@ 2010-06-04  1:54 Zhigang Wang
  0 siblings, 0 replies; only message in thread
From: Zhigang Wang @ 2010-06-04  1:54 UTC (permalink / raw)
  To: xen-devel

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

Hi all,

As the memory size is huge today and for backward compatibility with xm, I
recommend to use MB by default.

if use KB, a xl mem-set 0 1024 will invoke oom-killer and make dom0 hang.

Thanks,

Zhigang

[-- Attachment #2: xen-libxl-mem-set-max-default-mb.patch --]
[-- Type: text/plain, Size: 1564 bytes --]

xl: make mem-set and mem-max to use MB for memory unit by default.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>

diff -r 4ab68bf4c37e tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Jun 03 07:30:54 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Fri Jun 04 09:44:48 2010 +0800
@@ -1232,9 +1232,9 @@
         kbytes <<= 10;
     case 'g':
         kbytes <<= 10;
+    case '\0':
     case 'm':
         kbytes <<= 10;
-    case '\0':
     case 'k':
         break;
     case 'b':
@@ -1295,7 +1295,6 @@
         exit(1);
     }
 
-    printf("setting domid %d static max memory to : %s\n", domid, mem);
     exit(0);
 }
 
@@ -1311,7 +1310,6 @@
         exit(3);
     }
 
-    printf("setting domid %d memory to : %lld\n", domid, memorykb);
     libxl_set_memory_target(&ctx, domid, memorykb, /* enforce */ 1);
 }
 
diff -r 4ab68bf4c37e tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Thu Jun 03 07:30:54 2010 +0100
+++ b/tools/libxl/xl_cmdtable.c	Fri Jun 04 09:44:48 2010 +0800
@@ -121,12 +121,12 @@
     { "mem-max",
       &main_memmax,
       "Set the maximum amount reservation for a domain",
-      "<Domain> <MemKB['b'[bytes]|'k'[KB]|'m'[MB]|'g'[GB]|'t'[TB]]>",
+      "<Domain> <MemMB['b'[bytes]|'k'[KB]|'m'[MB]|'g'[GB]|'t'[TB]]>",
     },
     { "mem-set",
       &main_memset,
       "Set the current memory usage for a domain",
-      "<Domain> <MemKB['b'[bytes]|'k'[KB]|'m'[MB]|'g'[GB]|'t'[TB]]>",
+      "<Domain> <MemMB['b'[bytes]|'k'[KB]|'m'[MB]|'g'[GB]|'t'[TB]]>",
     },
     { "button-press",
       &main_button_press,

[-- 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] only message in thread

only message in thread, other threads:[~2010-06-04  1:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-04  1:54 [PATCH]xl: make mem-set and mem-max to use MB for memory unit by default Zhigang Wang

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.