[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5 3/8] sysctl: Make XEN_SYSCTL_topologyinfo sysctl a little more efficient



On 03/20/2015 09:25 AM, Ian Campbell wrote:
On Thu, 2015-03-19 at 17:53 -0400, Boris Ostrovsky wrote:
[...]
* Replace INVALID_TOPOLOGY_ID with "XEN_"-prefixed macros for each invalid type
   (core, socket, node).
But not for distance:

@@ -1375,7 +1360,7 @@ static PyObject *pyxc_numainfo(XcObject *self)
          for ( j = 0; j <= max_node_index; j++ )
          {
              uint32_t dist = nodes_dist[i*(max_node_index+1) + j];
-            if ( dist == INVALID_TOPOLOGY_ID )
+            if ( dist == ~0u )
?

This patch replaces INVALID_TOPOLOGY_ID with XEN_INVALID_CORE/SOCKET/NODE_ID for CPU topology. Neither of those would be appropriate for distance.

OTOH, the hypervisor never actually returns INVALID_TOPOLOGY_ID for "bad" distance -- it explicitly sets the value to ~0u (see XEN_SYSCTL_numainfo in do_sysctl()). Thing work since INVALID_TOPOLOGY_ID happens to be defined as ~0u, but only by accident.

The next patch (4/8) introduces XEN_INVALID_NODE_DIST and updates the hypervisor to report this value when distance is not available. And the hunk above is updated to use it as well.

Andrew noticed this too when reviewing previous version so it may be worth mentioning in the commit message.

-boris


Other than that the tools side here looks ok.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.