Re: [PATCHv2 1/2] To support huge-sized page in virtinst

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/23/2011 02:40 AM, Cole Robinson wrote:
On 12/15/2011 01:13 AM, Li Zhang wrote:
On some CPU architectures, huge-sized page are supported for
performance boost. However, virt-manager doesn't support the
feature of huge-sized page explicitly.

The patch is addressing the issue. Support of huge-sized page
will be implemented in the Guest object so that the virt-manager
can configure.


Sorry for the review delay.

I squashed these two virtinst patches together, added you to AUTHORS, and
pushed. Thanks a bunch!

- Cole


Got it, thanks :)
-Li

Signed-off-by: Li Zhang<zhlcindy@xxxxxxxxxxxxxxxxxx>
---
  virtinst/Guest.py |   16 +++++++++++++++-
  1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/virtinst/Guest.py b/virtinst/Guest.py
index 46ec340..a5d2e56 100644
--- a/virtinst/Guest.py
+++ b/virtinst/Guest.py
@@ -190,6 +190,7 @@ class Guest(XMLBuilderDomain.XMLBuilderDomain):
          self._uuid = None
          self._memory = None
          self._maxmemory = None
+        self._hugepage = None
          self._vcpus = 1
          self._maxvcpus = 1
          self._cpuset = None
@@ -343,6 +344,14 @@ class Guest(XMLBuilderDomain.XMLBuilderDomain):
                                xpath="./memory",
                                get_converter=lambda s, x: int(x) / 1024,
                                set_converter=lambda s, x: int(x) * 1024)
+    def get_hugepage(self):
+        return self._hugepage
+    def set_hugepage(self, val):
+        if val is None:
+            return val
+        self._hugepage = bool(val)
+    hugepage = _xml_property(get_hugepage, set_hugepage,
+                             xpath="./memoryBacking/hugepages", is_bool=True)

      # UUID for the guest
      def get_uuid(self):
@@ -1044,9 +1053,14 @@ class Guest(XMLBuilderDomain.XMLBuilderDomain):
          xml = add(desc_xml)
          xml = add("<memory>%s</memory>" % (self.maxmemory * 1024))
          xml = add("<currentMemory>%s</currentMemory>" % (self.memory * 1024))
+
          #<blkiotune>
          #<memtune>
-        #<memoryBacking>
+        if self.hugepage is True:
+            xml = add("<memoryBacking>")
+            xml = add("<hugepages/>")
+            xml = add("</memoryBacking>")
+
          xml = add(self._get_vcpu_xml())
          #<cputune>
          xml = add(self.numatune.get_xml_config())



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux