[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 01/18] numa: move source of default CPUs to N
From: |
David Gibson |
Subject: |
Re: [Qemu-devel] [PATCH v3 01/18] numa: move source of default CPUs to NUMA node mapping into boards |
Date: |
Thu, 11 May 2017 14:36:25 +1000 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Wed, May 10, 2017 at 01:29:45PM +0200, Igor Mammedov wrote:
> Originally CPU threads were by default assigned in
> round-robin fashion. However it was causing issues in
> guest since CPU threads from the same socket/core could
> be placed on different NUMA nodes.
> Commit fb43b73b (pc: fix default VCPU to NUMA node mapping)
> fixed it by grouping threads within a socket on the same node
> introducing cpu_index_to_socket_id() callback and commit
> 20bb648d (spapr: Fix default NUMA node allocation for threads)
> reused callback to fix similar issues for SPAPR machine
> even though socket doesn't make much sense there.
>
> As result QEMU ended up having 3 default distribution rules
> used by 3 targets /virt-arm, spapr, pc/.
>
> In effort of moving NUMA mapping for CPUs into possible_cpus,
> generalize default mapping in numa.c by making boards decide
> on default mapping and let them explicitly tell generic
> numa code to which node a CPU thread belongs to by replacing
> cpu_index_to_socket_id() with @cpu_index_to_instance_props()
> which provides default node_id assigned by board to specified
> cpu_index.
>
> Signed-off-by: Igor Mammedov <address@hidden>
> Reviewed-by: Eduardo Habkost <address@hidden>
Reviewed-by: David Gibson <address@hidden>
[snip]
> +static CpuInstanceProperties
> +virt_cpu_index_to_props(MachineState *ms, unsigned cpu_index)
> +{
> + MachineClass *mc = MACHINE_GET_CLASS(ms);
> + const CPUArchIdList *possible_cpus = mc->possible_cpu_arch_ids(ms);
> +
> + assert(cpu_index < possible_cpus->len);
> + return possible_cpus->cpus[cpu_index].props;
> +}
Suggested follow up patch: Since this function is identical for x86
and ARM, we could have a "thread_granularity_cpu_index_to_props"
helper they could both reference. M
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH v3 00/18] numa: add '-numa cpu' option, Igor Mammedov, 2017/05/10
- [Qemu-devel] [PATCH v3 02/18] spapr: add node-id property to sPAPR core, Igor Mammedov, 2017/05/10
- [Qemu-devel] [PATCH v3 03/18] pc: add node-id property to CPU, Igor Mammedov, 2017/05/10
- [Qemu-devel] [PATCH v3 01/18] numa: move source of default CPUs to NUMA node mapping into boards, Igor Mammedov, 2017/05/10
- Re: [Qemu-devel] [PATCH v3 01/18] numa: move source of default CPUs to NUMA node mapping into boards,
David Gibson <=
- [Qemu-devel] [PATCH v3 05/18] numa: add check that board supports cpu_index to node mapping, Igor Mammedov, 2017/05/10
- [Qemu-devel] [PATCH v3 06/18] numa: mirror cpu to node mapping in MachineState::possible_cpus, Igor Mammedov, 2017/05/10
- Re: [Qemu-devel] [PATCH v3 06/18] numa: mirror cpu to node mapping in MachineState::possible_cpus, Igor Mammedov, 2017/05/30
- Re: [Qemu-devel] [PATCH v3 06/18] numa: mirror cpu to node mapping in MachineState::possible_cpus, Eduardo Habkost, 2017/05/30
[Qemu-devel] [PATCH v3 04/18] virt-arm: add node-id property to CPU, Igor Mammedov, 2017/05/10
[Qemu-devel] [PATCH v3 07/18] numa: do default mapping based on possible_cpus instead of node_cpu bitmaps, Igor Mammedov, 2017/05/10