From mboxrd@z Thu Jan 1 00:00:00 1970 From: "James (song wei)" Subject: Re: [Patch] adjust the cpu-affinity to more than 64 cpus Date: Wed, 17 Mar 2010 19:26:08 -0700 (PDT) Message-ID: <27941020.post@talk.nabble.com> References: <27928229.post@talk.nabble.com> <4BA0AE00020000780003576C@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4BA0AE00020000780003576C@vpn.id2.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Jan Beulich wrote: >=20 >>>> "James (song wei)" 17.03.10 09:56 >>> >>--- a/tools/python/xen/lowlevel/xc/xc.c=09Mon Mar 15 17:08:29 2010 +0000 >>+++ b/tools/python/xen/lowlevel/xc/xc.c=09Wed Mar 17 16:51:07 2010 +0800 >>@@ -215,35 +215,54 @@ >> { >> uint32_t dom; >> int vcpu =3D 0, i; >>- uint64_t cpumap =3D ~0ULL; >>+ uint64_t *cpumap; >> PyObject *cpulist =3D NULL; >>+ int nr_cpus, size; >>+ xc_physinfo_t info;=20 >>+ xc_cpu_to_node_t map[1]; >>+ uint64_t cpumap_size =3D sizeof(cpumap);=20 >=20 > Perhaps sizeof(*cpumap)?=20 >=20 > -- Yeah=EF=BC=8Cyou are right. >=20 >>... >>+ *(cpumap + cpu / (cpumap_size * 8)) |=3D (uint64_t)1 << (cpu= % > (cpumap_size * 8)); >=20 > Using [] here and in similar places further down would likely make these > constructs a little bit more legible. > --yes.=20 >=20 >>@@ -362,7 +381,11 @@ >> uint32_t dom, vcpu =3D 0; >> xc_vcpuinfo_t info; >> int rc, i; >>- uint64_t cpumap; >>+ uint64_t *cpumap; >>+ int nr_cpus, size; >>+ xc_physinfo_t pinfo =3D { 0 }; >>+ xc_cpu_to_node_t map[1]; >>+ uint64_t cpumap_size =3D sizeof(cpumap); >=20 > Same as above. > =20 >>@@ -385,17 +421,18 @@ >> "cpu", info.cpu); >>=20 >> cpulist =3D PyList_New(0); >>- for ( i =3D 0; cpumap !=3D 0; i++ ) >>+ for ( i =3D 0; i < size * cpumap_size * 8; i++ ) >=20 > Why not simply use nr_cpus here? > --Yes, copy amount of nr_cpus bitsare enough here. >=20 > Jan, thank you very much! I'll post the new patch here soon. >=20 > -Jame (Song Wei) >=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >=20 >=20 --=20 View this message in context: http://old.nabble.com/-Patch--adjust-the-cpu-= affinity-to-more-than-64-cpus-tp27928229p27941020.html Sent from the Xen - Dev mailing list archive at Nabble.com.