Hi Drew,

On 2021/4/27 22:58, Andrew Jones wrote:
On Tue, Apr 13, 2021 at 04:07:45PM +0800, Yanan Wang wrote:
From: Andrew Jones <[email protected]>

The virt machine type has never used the CPU topology parameters, other
than number of online CPUs and max CPUs. When choosing how to allocate
those CPUs the default has been to assume cores. In preparation for
using the other CPU topology parameters let's use an smp_parse that
prefers cores over sockets. We can also enforce the topology matches
max_cpus check because we have no legacy to preserve.

Signed-off-by: Andrew Jones <[email protected]>
Signed-off-by: Yanan Wang <[email protected]>
---
  hw/arm/virt.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 76 insertions(+)
Thanks, this patch matches [1]. Of course, I've always considered this
patch to be something of an RFC, though. Is there any harm in defaulting
to sockets over cores? If not, I wonder if we shouldn't just leave the
default as it is to avoid a mach-virt specific smp parser.
From my view, I did't find any harm in defaulting to sockets over cores, but I'm not really sure.. At least, the arch-neutral function smp_parse and pc_smp_parse for x86 all prefer sockets over cores in default.
  The "no
topology" compat variable will keep existing machine types from switching
from cores to sockets, so we don't need to worry about that.
Yes, I agree about this.

Thanks,
Yanan
[1] 
https://github.com/rhdrjones/qemu/commit/c0670b1bccb4d08c7cf7c6957cc8878a2af131dd

Thanks,
drew


.

Reply via email to