[openstack-dev] [openstack-dev[[nova] Simple question about sorting CPU topologies

Jay Pipes jaypipes at gmail.com
Tue Jun 20 12:29:15 UTC 2017

On 06/19/2017 10:45 PM, Zhenyu Zheng wrote:
> Sorry, The mail sent accidentally by mis-typing ...
> My question is, what is the benefit of the above preference?

Hi Kevin!

I believe the benefit is so that the compute node prefers CPU topologies 
that do not have hardware threads over CPU topologies that do include 
hardware threads.

I'm not sure exactly of the reason for this preference, but perhaps it 
is due to assumptions that on some hardware, threads will compete for 
the same cache resources as other siblings on a core whereas cores may 
have their own caches (again, on some specific hardware).


> On Tue, Jun 20, 2017 at 10:43 AM, Zhenyu Zheng 
> <zhengzhenyulixi at gmail.com <mailto:zhengzhenyulixi at gmail.com>> wrote:
>     Hi,
>     In
>     https://github.com/openstack/nova/blob/master/nova/virt/hardware.py#L396
>     <https://github.com/openstack/nova/blob/master/nova/virt/hardware.py#L396>
>     we calculated every possible CPU topologies and sorted by:
>     # We want to
>     	# - Minimize threads (ie larger sockets * cores is best)
>     	# - Prefer sockets over cores
>     	possible = sorted(possible, reverse=True,
>     	key=lambda x: (x.sockets * x.cores,
>     	x.sockets,
>     	x.threads))
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

More information about the OpenStack-dev mailing list