From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: [PATCH]: xl: fix broken cpupool-numa-split Date: Thu, 27 Jan 2011 22:36:07 +0100 Message-ID: <4D41E547.5000902@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010802090708040901000306" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: Juergen Gross , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --------------010802090708040901000306 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Hi, the implementation of xl cpupool-numa-split is broken. It basically deals with only one poolid, but there are two to consider: the one from the original root CPUpool, the other from the newly created one. On my machine the current output looks like: root@dosorca:/data/images# xl cpupool-numa-split libxl: error: libxl.c:2803:libxl_create_cpupool Could not create cpupool error on creating cpupool root@dosorca:/data/images# xl cpupool-list Name CPUs Sched Active Domain count Pool-node0 42 credit y 1 Pool-node1 0 credit y 0 root@dosorca:/data/images# xl cpupool-list -c Name CPU list Pool-node0 0,1,2,3,4,5,6,7,8,9,10,11,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47 Pool-node1 The patch fixes this by using two poolid variables, now it looks like: root@dosorca:/data/images# xl cpupool-numa-split root@dosorca:/data/images# xl cpupool-list Name CPUs Sched Active Domain count Pool-node0 6 credit y 1 Pool-node1 6 credit y 0 Pool-node2 6 credit y 0 Pool-node3 6 credit y 0 Pool-node4 6 credit y 0 Pool-node5 6 credit y 0 Pool-node6 6 credit y 0 Pool-node7 6 credit y 0 root@dosorca:/data/images# xl cpupool-list -c Name CPU list Pool-node0 0,1,2,3,4,5 Pool-node1 6,7,8,9,10,11 Pool-node2 12,13,14,15,16,17 Pool-node3 18,19,20,21,22,23 Pool-node4 24,25,26,27,28,29 Pool-node5 30,31,32,33,34,35 Pool-node6 36,37,38,39,40,41 Pool-node7 42,43,44,45,46,47 Please apply to Xen 4.1.0-rc Regards, Andre. Signed-off-by: Andre Przywara -- Andre Przywara AMD-Operating System Research Center (OSRC), Dresden, Germany --------------010802090708040901000306 Content-Type: text/plain; name="xl_fix_cpupool_numasplit.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xl_fix_cpupool_numasplit.patch" Content-Description: xl_fix_cpupool_numasplit.patch diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 5f2cab2..8ecc10b 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -5716,7 +5716,7 @@ int main_cpupoolnumasplit(int argc, char **argv) int p; int c; int n; - uint32_t poolid; + uint32_t poolid_root, poolid_new; int schedid; int n_pools; int node; @@ -5743,7 +5743,7 @@ int main_cpupoolnumasplit(int argc, char **argv) fprintf(stderr, "error getting cpupool info\n"); return -ERROR_NOMEM; } - poolid = poolinfo[0].poolid; + poolid_root = poolinfo[0].poolid; schedid = poolinfo[0].sched_id; for (p = 0; p < n_pools; p++) { libxl_cpupoolinfo_destroy(poolinfo + p); @@ -5768,13 +5768,13 @@ int main_cpupoolnumasplit(int argc, char **argv) a cpupool without cpus in between */ node = topology.nodemap.array[0]; - if (libxl_cpupool_cpuadd_node(&ctx, 0, node, &n)) { + if (libxl_cpupool_cpuadd_node(&ctx, poolid_root, node, &n)) { fprintf(stderr, "error on adding cpu to Pool 0\n"); return -ERROR_FAIL; } snprintf(name, 15, "Pool-node%d", node); - ret = -libxl_cpupool_rename(&ctx, name, 0); + ret = -libxl_cpupool_rename(&ctx, name, poolid_root); if (ret) { fprintf(stderr, "error on renaming Pool 0\n"); goto out; @@ -5792,7 +5792,7 @@ int main_cpupoolnumasplit(int argc, char **argv) } node = topology.nodemap.array[c]; - ret = -libxl_cpupool_cpuremove_node(&ctx, 0, node, &n); + ret = -libxl_cpupool_cpuremove_node(&ctx, poolid_root, node, &n); if (ret) { fprintf(stderr, "error on removing cpu from Pool 0\n"); goto out; @@ -5800,13 +5800,15 @@ int main_cpupoolnumasplit(int argc, char **argv) snprintf(name, 15, "Pool-node%d", node); libxl_uuid_generate(&uuid); - ret = -libxl_create_cpupool(&ctx, name, schedid, cpumap, &uuid, &poolid); + poolid_new = 0; + ret = -libxl_create_cpupool(&ctx, name, schedid, cpumap, &uuid, + &poolid_new); if (ret) { fprintf(stderr, "error on creating cpupool\n"); goto out; } - ret = -libxl_cpupool_cpuadd_node(&ctx, 0, node, &n); + ret = -libxl_cpupool_cpuadd_node(&ctx, poolid_new, node, &n); if (ret) { fprintf(stderr, "error on adding cpus to cpupool\n"); goto out; --------------010802090708040901000306 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------010802090708040901000306--