This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] Re: how to change the memory size of a VM

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: how to change the memory size of a VM
From: Jia Rao <rickenrao@xxxxxxxxx>
Date: Mon, 2 Nov 2009 15:54:07 -0500
Delivery-date: Mon, 02 Nov 2009 12:55:23 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ymy0wnX0PNRioIv075oTiCIBODxUCeeUW/50k3PW+fg=; b=g91fW+VPrW2lYzuwP3Bb+J6wAfLE2Jt2f+5dv9sZJpELW1FGTDKSqsAGBxz+4NKCP/ i7tPfrJnXUGPHzaVx6xxrjpVyAotuSvZ7fa33LikPf7/CIQK/6vOHkZrPS1KZOhbzxIr qd+H7x/zxmbl9e+jGumsADYsjHCtaDSbQMqvw=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=tGbAlRu9y4X3bESfHLVsHzsR2SMXy2v43mVjK4dw6HiQYfUg7IOHY8llxjkIWaAtvz kW46wKp8Wu80JFHI4BBTmT4RuFmNHA6gV2zFXxsuANpsiLGiftcwS+uPxOpCEBwX5bkV SU5Geu+2qXBMxJEXNzzSYLiWhJ4NIYxEGG4Rw=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <994429490911021242x476ce517l34b3aa5db2a3157@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <994429490911021242x476ce517l34b3aa5db2a3157@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

I am looking into a problem that when the memory size of a VM is changed which part of the original memory is taken away by xen.
For example, if I change the memory size of a VM from 2048MB --> 1024MB, how can I tell which are the 1024M byte that will be taken away (I do not want the xen to take the memory spaces that are caching useful data).

The command for memory size reconfiguration is "xm mem-set", so I looked the source code of xm.
It turned out to be the following python calls:

tools/python/xen/xm/main.py: setMemoryTarget(dom, mem_target)
tools/python/xen/xend/XendDomainInfo.py: setMemoryTarget:        
               self._safe_set_memory('memory_dynamic_min', target * MiB)
               self._safe_set_memory('memory_dynamic_max', target * MiB)

   tools/python/xen/xend/XendDomainInfo.py: _safe_set_memory
                  self.info[‘memory_dynamic_min’] = target
                  self.info[‘memory_dynamic_max’] = target

It seems that to change the memory size of a VM, you just need to save the new size in somewhere, xenstore?
How would the new size take effect? the memory mapping of the VM must be modified somewhere.

Look forward to replies, sorry if the question is stupid, a newbie here ^_^
Thanks in advance

Xen-devel mailing list