From: Rick Gonzalez <rcgneo@us.ibm.com>
To: Xen Developers <xen-devel@lists.xensource.com>
Subject: [xmtest PATCH] shadow_memory fix
Date: Thu, 31 Aug 2006 15:13:33 -0500 [thread overview]
Message-ID: <44F742ED.8090304@us.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 692 bytes --]
Team,
attached is a patch to fix xmtest. This is for bug# 751.
What basically did was include the "shadow_memory" parameter in the HVM
config file with 8MB by default. This fixes the problem alone. Now, I
went further and created a function to grow this memory as needed.
The stipulation is that there should be 2KB of memory for every one MB
of RAM assigned to the guest domain, plus a few MB per vcpu ( ~2MB).
The 8MB of shadow memory is more than enough for xmtest when concerning
RAM. The my function grows this shadow memory if we have more than 3
vcpus. This is just a safety precaution. :)
Please look at the patch and let me know what you think.
regards,
Rick Gonzalez
[-- Attachment #2: shadow-mem.patch --]
[-- Type: text/plain, Size: 1943 bytes --]
diff -Naur xen-unstable.hg/tools/xm-test/lib/XmTestLib/XenDomain.py xen-unstable-shadowfix.hg/tools/xm-test/lib/XmTestLib/XenDomain.py
--- xen-unstable.hg/tools/xm-test/lib/XmTestLib/XenDomain.py 2006-08-31 14:05:58.000000000 -0500
+++ xen-unstable-shadowfix.hg/tools/xm-test/lib/XmTestLib/XenDomain.py 2006-08-31 14:38:45.000000000 -0500
@@ -74,6 +74,7 @@
}
HVMDefaults = {"memory" : 64,
"vcpus" : 1,
+ "shadow_memory": 8,
"acpi" : 0,
"apic" : 0,
"disk" : ["file:%s/disk.img,ioemu:%s,w!" %
@@ -169,6 +170,18 @@
else:
self.opts = self.defaultOpts
+ def computeShadowMem(self):
+ """Shadow Memory checking/assignment (for HVM domains only).
+ 8MB by default. Minimum requirements for it is 2KB per every
+ 1MB of RAM assigned to guest domain, plus a few more MB per vcpu.
+ 8MB showld be enough but if vcpus is > 3, give 2MB more per vcpu."""
+
+ vcpus = self.getOpt("vcpus")
+ mem = self.getOpt("shadow_memory")
+ newmem = int(mem) + int(vcpus) * 2
+
+ return newmem
+
class DomainError(Exception):
def __init__(self, msg, extra="", errorcode=0):
self.msg = msg
@@ -329,7 +342,6 @@
return dev
print "Device %s not found for domain %s" % (id, self.getName())
-
class XmTestDomain(XenDomain):
def __init__(self, name=None, extraConfig=None, baseConfig=configDefaults):
@@ -343,6 +355,10 @@
if extraConfig:
config.setOpts(extraConfig)
+ # if HVM enabled then check shadow memory
+ if ( ENABLE_HVM_SUPPORT ) and ( int(config.getOpt("vcpus")) > 3):
+ config.setOpt("shadow_memory",config.computeShadowMem())
+
if name:
config.setOpt("name", name)
elif not config.getOpt("name"):
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2006-08-31 20:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44F742ED.8090304@us.ibm.com \
--to=rcgneo@us.ibm.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.