Change in vdsm[master]: numa: reorganize module
mpolednik at redhat.com
mpolednik at redhat.com
Mon Feb 29 14:39:27 UTC 2016
Martin Polednik has uploaded a new change for review.
Change subject: numa: reorganize module
......................................................................
numa: reorganize module
Change-Id: I7e8ca3092d4c14827d0965a535ef3d0ac7ba4b0a
Signed-off-by: Martin Polednik <mpolednik at redhat.com>
---
M lib/vdsm/numa.py
1 file changed, 34 insertions(+), 34 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/54167/1
diff --git a/lib/vdsm/numa.py b/lib/vdsm/numa.py
index ab1f814..9eac3f3 100644
--- a/lib/vdsm/numa.py
+++ b/lib/vdsm/numa.py
@@ -40,22 +40,30 @@
_AUTONUMA_STATUS_UNKNOWN = 2
- at utils.memoized
-def autonuma_status():
- out = _run_command(['-n', '-e', 'kernel.numa_balancing'])
+def memory_by_cell(index):
+ """
+ Get the memory stats of a specified numa node, the unit is MiB.
- if not out:
- return _AUTONUMA_STATUS_UNKNOWN
- elif out[0] == '0':
- return _AUTONUMA_STATUS_DISABLE
- elif out[0] == '1':
- return _AUTONUMA_STATUS_ENABLE
- else:
- return _AUTONUMA_STATUS_UNKNOWN
+ :param cell: the index of numa node
+ :type cell: int
+ :return: dict like {'total': '49141', 'free': '46783'}
+ """
+ meminfo = libvirtconnection.get().getMemoryStats(index, 0)
+ meminfo['total'] = str(meminfo['total'] / 1024)
+ meminfo['free'] = str(meminfo['free'] / 1024)
+ return meminfo
-def _get_libvirt_caps():
- return libvirtconnection.get().getCapabilities()
+def topology(capabilities=None):
+ return _numa(capabilities).topology
+
+
+def distances():
+ return _numa().distances
+
+
+def cpu_topology(capabilities=None):
+ return _numa(capabilities).cpu_topology
@utils.memoized
@@ -100,30 +108,22 @@
return NumaTopology(topology, distances, cpu_topology)
-def memory_by_cell(index):
- """
- Get the memory stats of a specified numa node, the unit is MiB.
+ at utils.memoized
+def autonuma_status():
+ out = _run_command(['-n', '-e', 'kernel.numa_balancing'])
- :param cell: the index of numa node
- :type cell: int
- :return: dict like {'total': '49141', 'free': '46783'}
- """
- meminfo = libvirtconnection.get().getMemoryStats(index, 0)
- meminfo['total'] = str(meminfo['total'] / 1024)
- meminfo['free'] = str(meminfo['free'] / 1024)
- return meminfo
+ if not out:
+ return _AUTONUMA_STATUS_UNKNOWN
+ elif out[0] == '0':
+ return _AUTONUMA_STATUS_DISABLE
+ elif out[0] == '1':
+ return _AUTONUMA_STATUS_ENABLE
+ else:
+ return _AUTONUMA_STATUS_UNKNOWN
-def topology(capabilities=None):
- return _numa(capabilities).topology
-
-
-def distances():
- return _numa().distances
-
-
-def cpu_topology(capabilities=None):
- return _numa(capabilities).cpu_topology
+def _get_libvirt_caps():
+ return libvirtconnection.get().getCapabilities()
def _run_command(args):
--
To view, visit https://gerrit.ovirt.org/54167
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e8ca3092d4c14827d0965a535ef3d0ac7ba4b0a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik at redhat.com>
More information about the vdsm-patches
mailing list