WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 3 of 4] Extend cpupools to support numa

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 3 of 4] Extend cpupools to support numa
From: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Date: Wed, 08 Dec 2010 13:07:50 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 08 Dec 2010 04:08:35 -0800
Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=ts.fujitsu.com; i=juergen.gross@xxxxxxxxxxxxxx; q=dns/txt; s=s1536b; t=1291810072; x=1323346072; h=message-id:date:from:mime-version:to:cc:subject: references:in-reply-to:content-transfer-encoding; z=Message-ID:=20<4CFF7516.90909@xxxxxxxxxxxxxx>|Date:=20We d,=2008=20Dec=202010=2013:07:50=20+0100|From:=20Juergen =20Gross=20<juergen.gross@xxxxxxxxxxxxxx>|MIME-Version: =201.0|To:=20Ian=20Campbell=20<Ian.Campbell@xxxxxxxxxx> |CC:=20"xen-devel@xxxxxxxxxxxxxxxxxxx"=20<xen-devel@lists .xensource.com>|Subject:=20Re:=20[Xen-devel]=20[PATCH=203 =20of=204]=20Extend=20cpupools=20to=20support=20numa |References:=20<d3880bd8b4674e0ec88d.1290755426@xxxxxxxxx sd.mch.fsc.net>=20<1291805935.13966.4513.camel@xxxxxxxxxx ensource.com>|In-Reply-To:=20<1291805935.13966.4513.camel @zakaz.uk.xensource.com>|Content-Transfer-Encoding:=207bi t; bh=v5cin/yPtdjcAof6K55syXb0F8nDlJtD1qpjttduBx0=; b=pOofOAtGN4eHVyyiJxbPqCytMr6vvgNR89AI4I4d5DNMxlilP4JfN2yl GbDQs3xrFj+K/10IlMsvwqd0VaH2yZneEMmi1wVw0pepShqj05MGFuafa 6iuJ6grTVIFbuqCae2Dj7Mu1OH2niJxN1yQpbw41V0VanKQ/ifhNzHqoF RpZ7GmyEJP47OqqIUk3+24Gf6vW3XzDscLBbMGaDN7SImxq72A4E+9E5j no1C3gg3TGRhTh8pfdE6qiKAlcOfR;
Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV: Received:Received:Message-ID:Date:From:Organization: User-Agent:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=RpPwCFRec4vR+CrcFnZcRPVSGSN6YcfjZOV/vUrijplenlOBcx3Kc7O0 Qx4Pf0uUaTbV/7uTX9EbVIaemwymuoRpdtRyvThsyzU4K9Im87Mgh2EbZ 3Fx+KKnnCvQ65QM3kYQcpvbAqQUraCsRxJuPrQPup2kc8ymVhi5TwZBCl IIp7JEFVvGL5Fw2kkjW39n9QwFS4qo/f/Lzffjolbn8J11QQxJRFsJmuG BnTgCluRT8lyR3IHNuUTxyf7ScxgI;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1291805935.13966.4513.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Fujitsu Technology Solutions
References: <d3880bd8b4674e0ec88d.1290755426@xxxxxxxxxxxxxxxxxxxxxxx> <1291805935.13966.4513.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101030 Iceowl/1.0b1 Icedove/3.0.10
On 12/08/10 11:58, Ian Campbell wrote:
See previous comments about the interface to libxl_get_topoplogy and
leaking the returned pointer value.

On Fri, 2010-11-26 at 07:10 +0000, Juergen Gross wrote:
+    if (libxl_get_freecpus(&ctx,&freemap)) {
+        fprintf(stderr, "libxl_get_freecpus failed\n");
+        return -ERROR_FAIL;
+    }
+
+    topology = libxl_get_topologyinfo(&ctx);
+    if (topology == NULL) {
+        fprintf(stderr, "libxl_get_topologyinfo failed\n");
+        return -ERROR_FAIL;
+    }
+
+    n = 0;
+    for (cpu = 0; cpu<  topology->nodemap.entries; cpu++) {
+        if (libxl_cpumap_test(&freemap, cpu)&&
+            (topology->nodemap.array[cpu] == node)&&
+            !libxl_cpupool_cpuadd(&ctx, poolid, cpu)) {
+                n++;
+        }
+    }

This sequence of actions look like they would make a useful addition to
the libxl interface as a helper function.

Not sure what it would be called, perhaps:
        libxl_cpupool_cpuadd_node(&ctx, poolid, node)
?

Okay.


+    for (p = 0; p<  n_pools; p++) {
+        if (poolinfo[p].poolid == poolid) {
+            for (cpu = 0; cpu<  topology->nodemap.entries; cpu++) {
+                if ((topology->nodemap.array[cpu] == node)&&
+                    libxl_cpumap_test(&poolinfo[p].cpumap, cpu)&&
+                    !libxl_cpupool_cpuremove(&ctx, poolid, cpu)) {
+                        n++;
+                }
+            }
+        }
+    }

also a helper function?

libxl_cpupool_cpuremove_node(&ctx, poolid, node)

Okay.


Isn't there an existing function to find a poolinfo from a poolid? (if
not then should there be?)

Currently it is only possible to get infos for ALL cpupools. As the
number of cpupools is expected to be not very large, this should be no
problem.
Perhaps it would make sense to create a helper function to locate the correct
poolinfo member based on the poolid.


Juergen

--
Juergen Gross                 Principal Developer Operating Systems
TSP ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@xxxxxxxxxxxxxx
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>