From 97010eb1f14dfe705d58bf94ad4eec2cb293f560 Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Wed, 9 May 2012 00:04:34 +0800 Subject: numad: Set memory policy from numad advisory nodeset Though numad will manage the memory allocation of task dynamically, it wants management application (libvirt) to pre-set the memory policy according to the advisory nodeset returned from querying numad, (just like pre-bind CPU nodeset for domain process), and thus the performance could benefit much more from it. This patch introduces new XML tag 'placement', value 'auto' indicates whether to set the memory policy with the advisory nodeset from numad, and its value defaults to the value of placement, or 'static' if 'nodeset' is specified. Example of the new XML tag's usage: Just like what current "numatune" does, the 'auto' numa memory policy setting uses libnuma's API too. If "placement" is "auto", and is not specified explicitly, a default will be added with "placement" set as "auto", and "mode" set as "strict". The following XML can now fully drive numad: 1) placement is 'auto', no is specified. 10 2) placement is 'auto', no 'placement' is specified for . 10 And it's also able to control the CPU placement and memory policy independently. e.g. 1) placement is 'auto', and placement is 'static' 10 2) placement is 'static', and placement is 'auto' 10 A follow up patch will change the XML formatting codes to always output 'placement' for , even it's 'static'. --- tests/qemuxml2xmltest.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/qemuxml2xmltest.c') diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 9bca066e6..256eed7e3 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -218,6 +218,7 @@ mymain(void) DO_TEST_FULL("seclabel-dynamic-override", false, WHEN_INACTIVE); DO_TEST("seclabel-static"); DO_TEST("seclabel-none"); + DO_TEST("numad-static-vcpu-no-numatune"); /* These tests generate different XML */ DO_TEST_DIFFERENT("balloon-device-auto"); @@ -228,6 +229,7 @@ mymain(void) DO_TEST_DIFFERENT("serial-target-port-auto"); DO_TEST_DIFFERENT("graphics-listen-network2"); DO_TEST_DIFFERENT("graphics-spice-timeout"); + DO_TEST_DIFFERENT("numad-auto-vcpu-no-numatune"); DO_TEST_DIFFERENT("metadata"); -- cgit v1.2.3-65-gdbad