xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: James Song <JSong@novell.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [Patch] adjust the cpu-affinity to more than 64 cpus
Date: Wed, 17 Mar 2010 09:25:04 +0000	[thread overview]
Message-ID: <4BA0AE00020000780003576C@vpn.id2.novell.com> (raw)
In-Reply-To: <27928229.post@talk.nabble.com>

>>> "James (song wei)" <jsong@novell.com> 17.03.10 09:56 >>>
>--- a/tools/python/xen/lowlevel/xc/xc.c	Mon Mar 15 17:08:29 2010 +0000
>+++ b/tools/python/xen/lowlevel/xc/xc.c	Wed Mar 17 16:51:07 2010 +0800
>@@ -215,35 +215,54 @@
> {
>     uint32_t dom;
>     int vcpu = 0, i;
>-    uint64_t  cpumap = ~0ULL;
>+    uint64_t  *cpumap;
>     PyObject *cpulist = NULL;
>+    int nr_cpus, size;
>+    xc_physinfo_t info; 
>+    xc_cpu_to_node_t map[1];
>+    uint64_t cpumap_size = sizeof(cpumap); 

Perhaps sizeof(*cpumap)?

>...
>+            *(cpumap + cpu / (cpumap_size * 8)) |= (uint64_t)1 << (cpu %
(cpumap_size * 8));

Using [] here and in similar places further down would likely make these
constructs a little bit more legible.

>@@ -362,7 +381,11 @@
>     uint32_t dom, vcpu = 0;
>     xc_vcpuinfo_t info;
>     int rc, i;
>-    uint64_t cpumap;
>+    uint64_t *cpumap;
>+    int nr_cpus, size;
>+    xc_physinfo_t pinfo = { 0 };
>+    xc_cpu_to_node_t map[1];
>+    uint64_t cpumap_size = sizeof(cpumap);

Same as above.
 
>@@ -385,17 +421,18 @@
>                               "cpu",      info.cpu);
> 
>     cpulist = PyList_New(0);
>-    for ( i = 0; cpumap != 0; i++ )
>+    for ( i = 0; i < size * cpumap_size * 8; i++ )

Why not simply use nr_cpus here?

Jan

  reply	other threads:[~2010-03-17  9:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17  8:56 [Patch] adjust the cpu-affinity to more than 64 cpus James (song wei)
2010-03-17  9:25 ` Jan Beulich [this message]
2010-03-18  2:26   ` James (song wei)
2010-03-18  3:41     ` James (song wei)
2010-03-19  3:14       ` Masaki Kanno
2010-03-19  9:09         ` James Song
2010-03-19  9:39           ` issue with c/s 21046 (was Re: [Patch] adjust the cpu-affinity to more than 64 cpus) Jan Beulich
2010-03-19 10:28           ` [Patch] adjust the cpu-affinity to more than64 cpus Masaki Kanno
2010-03-19 10:47           ` issue with c/s 21046 (was Re: [Patch] adjust the cpu-affinity to more than 64 cpus) James Song
2010-03-19 11:10           ` Jan Beulich
2010-03-30 18:23           ` [Patch] adjust the cpu-affinity to more than 64 cpus Liu, Jinsong
2010-03-31  2:12             ` James Song
2010-03-31  6:29             ` Masaki Kanno
2010-03-31  8:26               ` Liu, Jinsong

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=4BA0AE00020000780003576C@vpn.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=JSong@novell.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).