All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@amd.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Juergen Gross <juergen.gross@ts.fujitsu.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH]: xl: fix broken cpupool-numa-split
Date: Thu, 27 Jan 2011 22:36:07 +0100	[thread overview]
Message-ID: <4D41E547.5000902@amd.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2008 bytes --]

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.com>

-- 
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany

[-- Attachment #2: xl_fix_cpupool_numasplit.patch --]
[-- Type: text/plain, Size: 2475 bytes --]

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;

[-- 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:[~2011-01-27 21:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-27 21:36 Andre Przywara [this message]
2011-01-28  6:26 ` [PATCH]: xl: fix broken cpupool-numa-split Juergen Gross
2011-01-28 10:53   ` George Dunlap
2011-01-28 11:01     ` Juergen Gross
2011-01-28 17:41     ` Ian Jackson
2011-01-29  0:35   ` [PATCH] xl: fix broken cpupool-numa-split (part 2) Andre Przywara
2011-01-31  6:56     ` Juergen Gross
2011-02-01 19:07       ` Ian Jackson

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=4D41E547.5000902@amd.com \
    --to=andre.przywara@amd.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=juergen.gross@ts.fujitsu.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.