spapr, spapr_numa: fix max-associativity-domains
cover spapr, spapr_numa: fix max-associativity-domains
Hi,
Patches 02 and 03 contain fixes for a problem Cedric found out when booting TCG guests with multiple NUMA nodes. See patch 03 commit message for more info.
First patch is an unrelated cleanup I did while investigating.
Daniel Henrique Barboza (3):
spapr: move spapr_machine_using_legacy_numa() to spapr_numa.c spapr_numa.c: create spapr_numa_initial_nvgpu_NUMA_id() helper spapr_numa.c: fix ibm,max-associativity-domains calculation
hw/ppc/spapr.c | 21 ++------------------ hw/ppc/spapr_numa.c | 39 ++++++++++++++++++++++++++++++++++++- include/hw/ppc/spapr.h | 1 - include/hw/ppc/spapr_numa.h | 1 + 4 files changed, 41 insertions(+), 21 deletions(-)
Signature · 1 line
2.26.2
PATCH 1/3 spapr: move spapr_machine_using_legacy_numa() to spapr_numa.c
This function is used only in spapr_numa.c.
--- hw/ppc/spapr.c | 9 --------- hw/ppc/spapr_numa.c | 9 +++++++++ include/hw/ppc/spapr.h | 1 - 3 files changed, 9 insertions(+), 10 deletions(-)
hw/ppc/spapr.c +0 -9
@@ -295,15 +295,6 @@ static hwaddr spapr_node0_size(MachineState *machine)return machine->ram_size; } -bool spapr_machine_using_legacy_numa (SpaprMachineState *spapr) -{ -MachineState *machine =MACHINE (spapr); -SpaprMachineClass *smc =SPAPR_MACHINE_GET_CLASS (machine); - -return smc->pre_5_2_numa_associativity || - machine->numa_state->num_nodes <=1 ; -} -static void add_str (GString *s,const gchar *s1) {g_string_append_len (s, s1,strlen (s1) +1 );
hw/ppc/spapr_numa.c +9 -0
@@ -19,6 +19,15 @@/* Moved from hw/ppc/spapr_pci_nvlink2.c */ #define SPAPR_GPU_NUMA_ID (cpu_to_be32(1)) +static bool spapr_machine_using_legacy_numa (SpaprMachineState *spapr) +{ +MachineState *machine =MACHINE (spapr); +SpaprMachineClass *smc =SPAPR_MACHINE_GET_CLASS (machine); + +return smc->pre_5_2_numa_associativity || + machine->numa_state->num_nodes <=1 ; +} +static bool spapr_numa_is_symmetrical (MachineState *ms) {int src, dst;
include/hw/ppc/spapr.h +0 -1
@@ -851,7 +851,6 @@ int spapr_max_server_number(SpaprMachineState *spapr);void spapr_store_hpte (PowerPCCPU *cpu,hwaddr ptex,uint64_t pte0,uint64_t pte1);void spapr_mce_req_event (PowerPCCPU *cpu,bool recovered); -bool spapr_machine_using_legacy_numa (SpaprMachineState *spapr);/* DRC callbacks. */ void spapr_core_release (DeviceState *dev);
Signature · 1 line
2.26.2
Re: [PATCH 1/3] spapr: move spapr_machine_using_legacy_numa() to spapr_numa.c
Quoted 4 lines · On Thu, 28 Jan 2021 12:17:29 -0300 Daniel Henrique Barboza…
This function is used only in
spapr_numa.c.Signed-off-by Daniel Henrique Barboza <[email protected]>---
Quoted 57 lines
hw/ppc/spapr.c | 9 --------- hw/ppc/spapr_numa.c | 9 +++++++++ include/hw/ppc/spapr.h | 1 - 3 files changed, 9 insertions(+), 10 deletions(-)hw/ppc/spapr.c +0
-9@@ -295,15 +295,6 @@ static hwaddr spapr_node0_size(MachineState *machine)return machine->ram_size; } -bool spapr_machine_using_legacy_numa (SpaprMachineState *spapr) -{ -MachineState *machine =MACHINE (spapr); -SpaprMachineClass *smc =SPAPR_MACHINE_GET_CLASS (machine); - -return smc->pre_5_2_numa_associativity || - machine->numa_state->num_nodes <=1 ; -} -static void add_str (GString *s,const gchar *s1) {g_string_append_len (s, s1,strlen (s1) +1 );hw/ppc/spapr_numa.c +9
-0@@ -19,6 +19,15 @@/* Moved from hw/ppc/spapr_pci_nvlink2.c */ #define SPAPR_GPU_NUMA_ID (cpu_to_be32(1)) +static bool spapr_machine_using_legacy_numa (SpaprMachineState *spapr) +{ +MachineState *machine =MACHINE (spapr); +SpaprMachineClass *smc =SPAPR_MACHINE_GET_CLASS (machine); + +return smc->pre_5_2_numa_associativity || + machine->numa_state->num_nodes <=1 ; +} +static bool spapr_numa_is_symmetrical (MachineState *ms) {int src, dst;include/hw/ppc/spapr.h +0
-1@@ -851,7 +851,6 @@ int spapr_max_server_number(SpaprMachineState *spapr);void spapr_store_hpte (PowerPCCPU *cpu,hwaddr ptex,uint64_t pte0,uint64_t pte1);void spapr_mce_req_event (PowerPCCPU *cpu,bool recovered); -bool spapr_machine_using_legacy_numa (SpaprMachineState *spapr);/* DRC callbacks. */ void spapr_core_release (DeviceState *dev);
David Gibson
AppliedRe: [PATCH 1/3] spapr: move spapr_machine_using_legacy_numa() to spapr_numa.c
In reply to Daniel Henrique BarbozaQuoted 3 lines · Daniel Henrique Barboza
This function is used only in
spapr_numa.c.Signed-off-by Daniel Henrique Barboza <[email protected]>
Applied to ppc-for-6.0, thanks.
Quoted 58 lines
--- hw/ppc/spapr.c | 9 --------- hw/ppc/spapr_numa.c | 9 +++++++++ include/hw/ppc/spapr.h | 1 - 3 files changed, 9 insertions(+), 10 deletions(-)hw/ppc/spapr.c +0
-9@@ -295,15 +295,6 @@ static hwaddr spapr_node0_size(MachineState *machine)return machine->ram_size; } -bool spapr_machine_using_legacy_numa (SpaprMachineState *spapr) -{ -MachineState *machine =MACHINE (spapr); -SpaprMachineClass *smc =SPAPR_MACHINE_GET_CLASS (machine); - -return smc->pre_5_2_numa_associativity || - machine->numa_state->num_nodes <=1 ; -} -static void add_str (GString *s,const gchar *s1) {g_string_append_len (s, s1,strlen (s1) +1 );hw/ppc/spapr_numa.c +9
-0@@ -19,6 +19,15 @@/* Moved from hw/ppc/spapr_pci_nvlink2.c */ #define SPAPR_GPU_NUMA_ID (cpu_to_be32(1)) +static bool spapr_machine_using_legacy_numa (SpaprMachineState *spapr) +{ +MachineState *machine =MACHINE (spapr); +SpaprMachineClass *smc =SPAPR_MACHINE_GET_CLASS (machine); + +return smc->pre_5_2_numa_associativity || + machine->numa_state->num_nodes <=1 ; +} +static bool spapr_numa_is_symmetrical (MachineState *ms) {int src, dst;include/hw/ppc/spapr.h +0
-1@@ -851,7 +851,6 @@ int spapr_max_server_number(SpaprMachineState *spapr);void spapr_store_hpte (PowerPCCPU *cpu,hwaddr ptex,uint64_t pte0,uint64_t pte1);void spapr_mce_req_event (PowerPCCPU *cpu,bool recovered); -bool spapr_machine_using_legacy_numa (SpaprMachineState *spapr);/* DRC callbacks. */ void spapr_core_release (DeviceState *dev);
Signature · 4 lines
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
PATCH 2/3 spapr_numa.c: create spapr_numa_initial_nvgpu_NUMA_id() helper
In reply to Daniel Henrique BarbozaWe'll need to check the initial value given to spapr->gpu_numa_id when building the rtas DT, so put it in a helper for easier access and to avoid repetition.
--- hw/ppc/spapr.c | 12 ++---------- hw/ppc/spapr_numa.c | 14 ++++++++++++++ include/hw/ppc/spapr_numa.h | 1 + 3 files changed, 17 insertions(+), 10 deletions(-)
hw/ppc/spapr.c +2 -10
@@ -2765,16 +2765,8 @@ static void spapr_machine_init(MachineState *machine) } -/* -* NVLink2-connected GPU RAM needs to be placed on a separate NUMA node. -* We assign a new numa ID per GPU in spapr_pci_collect_nvgpu() which is -* called from vPHB reset handler so we initialize the counter here. -* If no NUMA is configured from the QEMU side, we start from 1 as GPU RAM -* must be equally distant from any other node. -* The final value of spapr->gpu_numa_id is going to be written to -* max-associativity-domains in spapr_build_fdt(). -*/ - spapr->gpu_numa_id =MAX (1 , machine->numa_state->num_nodes); +/* Init gpu_numa_id */ + spapr->gpu_numa_id =spapr_numa_initial_nvgpu_NUMA_id (machine);/* Init numa_assoc_array */ spapr_numa_associativity_init (spapr, machine);
hw/ppc/spapr_numa.c +14 -0
@@ -46,6 +46,20 @@ static bool spapr_numa_is_symmetrical(MachineState *ms)return true; } +/* +* NVLink2-connected GPU RAM needs to be placed on a separate NUMA node. +* We assign a new numa ID per GPU in spapr_pci_collect_nvgpu() which is +* called from vPHB reset handler so we initialize the counter here. +* If no NUMA is configured from the QEMU side, we start from 1 as GPU RAM +* must be equally distant from any other node. +* The final value of spapr->gpu_numa_id is going to be written to +* max-associativity-domains in spapr_build_fdt(). +*/ +unsigned int spapr_numa_initial_nvgpu_NUMA_id (MachineState *machine) +{ +return MAX (1 , machine->numa_state->num_nodes); +} +/* * This function will translate the user distances into * what the kernel understand as possible values: 10
include/hw/ppc/spapr_numa.h +1 -0
@@ -31,5 +31,6 @@ int spapr_numa_fixup_cpu_dt(SpaprMachineState *spapr, void *fdt, int offset, PowerPCCPU *cpu);int spapr_numa_write_assoc_lookup_arrays (SpaprMachineState *spapr,void *fdt,int offset); +unsigned int spapr_numa_initial_nvgpu_NUMA_id (MachineState *machine);#endif /* HW_SPAPR_NUMA_H */
Signature · 1 line
2.26.2
Re: [PATCH 2/3] spapr_numa.c: create spapr_numa_initial_nvgpu_NUMA_id() helper
Quoted 20 lines · On Thu, 28 Jan 2021 12:17:30 -0300 Daniel Henrique Barboza…
We'll need to check the initial value given to
spapr->gpu_numa_idwhen building the rtas DT, so put it in a helper for easier access and to avoid repetition.Signed-off-by Daniel Henrique Barboza <[email protected]>--- hw/ppc/spapr.c | 12 ++---------- hw/ppc/spapr_numa.c | 14 ++++++++++++++ include/hw/ppc/spapr_numa.h | 1 + 3 files changed, 17 insertions(+), 10 deletions(-)hw/ppc/spapr.c +0
-1@@ -2765,16 +2765,8 @@ static void spapr_machine_init(MachineState *machine) } -/*
hw/ppc/spapr.c static void spapr_machine_init(MachineState *machine) · line 2768
Quoted 10 lines
hw/ppc/spapr.c +1
-9-* NVLink2-connected GPU RAM needs to be placed on a separate NUMA node. -* We assign a new numa ID per GPU in spapr_pci_collect_nvgpu() which is -* called from vPHB reset handler so we initialize the counter here. -* If no NUMA is configured from the QEMU side, we start from 1 as GPU RAM -* must be equally distant from any other node. -* The final value of spapr->gpu_numa_id is going to be written to -* max-associativity-domains in spapr_build_fdt(). -*/ - spapr->gpu_numa_id =MAX (1 , machine->numa_state->num_nodes); +/* Init gpu_numa_id */
Code is trivial enough you don't really need to paraphrase with a comment.
hw/ppc/spapr.c static void spapr_machine_init(MachineState *machine) · line 2770
Quoted 2 lines
hw/ppc/spapr.c +1
-0+ spapr->gpu_numa_id =spapr_numa_initial_nvgpu_NUMA_id (machine);
This _NUMA_ looks a bit aggressive and not especially informative to me. Maybe just make it spapr_numa_initial_nvgpu_id() ?
With these fixed,
Quoted 38 lines
hw/ppc/spapr.c +0
-0/* Init numa_assoc_array */ spapr_numa_associativity_init (spapr, machine);hw/ppc/spapr_numa.c +14
-0@@ -46,6 +46,20 @@ static bool spapr_numa_is_symmetrical(MachineState *ms)return true; } +/* +* NVLink2-connected GPU RAM needs to be placed on a separate NUMA node. +* We assign a new numa ID per GPU in spapr_pci_collect_nvgpu() which is +* called from vPHB reset handler so we initialize the counter here. +* If no NUMA is configured from the QEMU side, we start from 1 as GPU RAM +* must be equally distant from any other node. +* The final value of spapr->gpu_numa_id is going to be written to +* max-associativity-domains in spapr_build_fdt(). +*/ +unsigned int spapr_numa_initial_nvgpu_NUMA_id (MachineState *machine) +{ +return MAX (1 , machine->numa_state->num_nodes); +} +/* * This function will translate the user distances into * what the kernel understand as possible values: 10 include/hw/ppc/spapr_numa.h +1
-0@@ -31,5 +31,6 @@ int spapr_numa_fixup_cpu_dt(SpaprMachineState *spapr, void *fdt, int offset, PowerPCCPU *cpu);int spapr_numa_write_assoc_lookup_arrays (SpaprMachineState *spapr,void *fdt,int offset); +unsigned int spapr_numa_initial_nvgpu_NUMA_id (MachineState *machine);#endif /* HW_SPAPR_NUMA_H */
PATCH 3/3 spapr_numa.c: fix ibm, max-associativity-domains calculation
In reply to Daniel Henrique BarbozaThe current logic for calculating 'maxdomain' making it a sum of numa_state->num_nodes with spapr->gpu_numa_id. spapr->gpu_numa_id is used as a index to determine the next available NUMA id that a given NVGPU can use.
The problem is that the initial value of gpu_numa_id, for any topology that has more than one NUMA node, is equal to numa_state->num_nodes. This means that our maxdomain will always be, at least, twice the amount of existing NUMA nodes. This means that a guest with 4 NUMA nodes will end up with the following max-associativity-domains:
rtas/ibm,max-associativity-domains
00000004 00000008 00000008 00000008 00000008
This overtuning of maxdomains doesn't go unnoticed in the guest, being detected in SLUB during boot:
dmesg | grep SLUB
[ 0.000000] SLUB: HWalign=128, Order=0-3, MinObjects=0, CPUs=4, Nodes=8
SLUB is detecting 8 total nodes, with 4 nodes being online.
This patch fixes ibm,max-associativity-domains by considering the amount of NVGPUs NUMA nodes presented in the guest, instead of spapr->gpu_numa_id.
--- hw/ppc/spapr_numa.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
hw/ppc/spapr_numa.c +15 -1
@@ -60,6 +60,19 @@ unsigned int spapr_numa_initial_nvgpu_NUMA_id(MachineState *machine)return MAX (1 , machine->numa_state->num_nodes); } +/* +* Note: if called before spapr_phb_pci_collect_nvgpu() finishes collecting +* all NVGPUs, this function will not give the right number of NVGPUs NUMA +* nodes. +*/ +static +unsigned int spapr_numa_get_number_nvgpus_nodes (SpaprMachineState *spapr) +{ +MachineState *ms =MACHINE (spapr); + +return spapr->gpu_numa_id -spapr_numa_initial_nvgpu_NUMA_id (ms); +} +/* * This function will translate the user distances into * what the kernel understand as possible values: 10
@@ -311,6 +324,7 @@ void spapr_numa_write_rtas_dt(SpaprMachineState *spapr, void *fdt, int rtas) {MachineState *ms =MACHINE (spapr);SpaprMachineClass *smc =SPAPR_MACHINE_GET_CLASS (spapr); +uint32_t number_nvgpus_nodes =spapr_numa_get_number_nvgpus_nodes (spapr);uint32_t refpoints[] = {cpu_to_be32 (0x4 ),cpu_to_be32 (0x3 ),
@@ -318,7 +332,7 @@ void spapr_numa_write_rtas_dt(SpaprMachineState *spapr, void *fdt, int rtas) cpu_to_be32(0x1), };uint32_t nr_refpoints =ARRAY_SIZE (refpoints); -uint32_t maxdomain = ms->numa_state->num_nodes + spapr->gpu_numa_id; +uint32_t maxdomain = ms->numa_state->num_nodes + number_nvgpus_nodes;uint32_t maxdomains[] = {cpu_to_be32 (4 ),cpu_to_be32 (maxdomain),
Signature · 1 line
2.26.2
Re: [PATCH 3/3] spapr_numa.c: fix ibm,max-associativity-domains calculation
Quoted 37 lines · On Thu, 28 Jan 2021 12:17:31 -0300 Daniel Henrique Barboza…
The current logic for calculating 'maxdomain' making it a sum of
numa_state->num_nodeswithspapr->gpu_numa_id.spapr->gpu_numa_idis used as a index to determine the next available NUMA id that a given NVGPU can use.The problem is that the initial value of
gpu_numa_id, for any topology that has more than one NUMA node, is equal tonuma_state->num_nodes. This means that our maxdomain will always be, at least, twice the amount of existing NUMA nodes. This means that a guest with 4 NUMA nodes will end up with the following max-associativity-domains:rtas/ibm,max-associativity-domains
00000004 00000008 00000008 00000008 00000008This overtuning of maxdomains doesn't go unnoticed in the guest, being detected in SLUB during boot:
dmesg | grep SLUB
[ 0.000000] SLUB: HWalign=128, Order=0-3, MinObjects=0, CPUs=4, Nodes=8SLUB is detecting 8 total nodes, with 4 nodes being online.
This patch fixes ibm,max-associativity-domains by considering the amount of NVGPUs NUMA nodes presented in the guest, instead of
spapr->gpu_numa_id.Reported-by Cédric Le Goater <[email protected]>Signed-off-by Daniel Henrique Barboza <[email protected]>--- hw/ppc/spapr_numa.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)hw/ppc/spapr_numa.c +0
-0
hw/ppc/spapr_numa.c unsigned int spapr_numa_initial_nvgpu_NUMA_id(MachineState *machine) · line 67
Quoted 8 lines
hw/ppc/spapr_numa.c +5
-0@@ -60,6 +60,19 @@ unsigned int spapr_numa_initial_nvgpu_NUMA_id(MachineState *machine)return MAX (1 , machine->numa_state->num_nodes); } +/* +* Note: if called before spapr_phb_pci_collect_nvgpu() finishes collecting +* all NVGPUs, this function will not give the right number of NVGPUs NUMA +* nodes. +*/
This helper has exactly one user : spapr_numa_write_rtas_dt(). Maybe just open-code it there, with a comment that spapr->gpu_numa_id is assumed to be correct at the time we populate the device tree ?
Quoted 28 lines
hw/ppc/spapr_numa.c +10
-1+static +unsigned int spapr_numa_get_number_nvgpus_nodes (SpaprMachineState *spapr) +{ +MachineState *ms =MACHINE (spapr); + +return spapr->gpu_numa_id -spapr_numa_initial_nvgpu_NUMA_id (ms); +} +/* * This function will translate the user distances into * what the kernel understand as possible values: 10 @@ -311,6 +324,7 @@ void spapr_numa_write_rtas_dt(SpaprMachineState *spapr, void *fdt, int rtas) {MachineState *ms =MACHINE (spapr);SpaprMachineClass *smc =SPAPR_MACHINE_GET_CLASS (spapr); +uint32_t number_nvgpus_nodes =spapr_numa_get_number_nvgpus_nodes (spapr);uint32_t refpoints[] = {cpu_to_be32 (0x4 ),cpu_to_be32 (0x3 ),@@ -318,7 +332,7 @@ void spapr_numa_write_rtas_dt(SpaprMachineState *spapr, void *fdt, int rtas) cpu_to_be32(0x1), };uint32_t nr_refpoints =ARRAY_SIZE (refpoints); -uint32_t maxdomain = ms->numa_state->num_nodes + spapr->gpu_numa_id; +uint32_t maxdomain = ms->numa_state->num_nodes + number_nvgpus_nodes;uint32_t maxdomains[] = {cpu_to_be32 (4 ),cpu_to_be32 (maxdomain),
Quoted 6 lines · On Thu, 28 Jan 2021 12:17:28 -0300 Daniel Henrique Barboza…
Hi,
Patches 02 and 03 contain fixes for a problem Cedric found out when booting TCG guests with multiple NUMA nodes. See patch 03 commit message for more info.
This paragraph mentions "TCG guests", but I see nothing that is specific to TCG in these patches... so I expect the problem to also exists with KVM, right ?
Quoted 13 lines
First patch is an unrelated cleanup I did while investigating.
Daniel Henrique Barboza (3):
spapr: movespapr_machine_using_legacy_numa()tospapr_numa.cspapr_numa.c: createspapr_numa_initial_nvgpu_NUMA_id()helperspapr_numa.c: fix ibm,max-associativity-domains calculationhw/ppc/spapr.c | 21 ++------------------ hw/ppc/spapr_numa.c | 39 ++++++++++++++++++++++++++++++++++++- include/hw/ppc/spapr.h | 1 - include/hw/ppc/spapr_numa.h | 1 + 4 files changed, 41 insertions(+), 21 deletions(-)
Quoted 5 lines · Greg Kurz
Quoted 2 lines · On Thu, 28 Jan 2021 12:17:28 -0300 Daniel Henrique Barboza…
Hi,
Quoted 8 lines
Quoted 4 lines
Patches 02 and 03 contain fixes for a problem Cedric found out when booting TCG guests with multiple NUMA nodes. See patch 03 commit message for more info.
This paragraph mentions "TCG guests", but I see nothing that is specific to TCG in these patches... so I expect the problem to also exists with KVM, right ?
Yeah. I mentioned TCG because this is the use case Cedric reproduced the bug with, but I myself had no problems reproducing it with accel=kvm as well.
DHB
Quoted 15 lines
Quoted 14 lines
First patch is an unrelated cleanup I did while investigating.
Daniel Henrique Barboza (3):
spapr: movespapr_machine_using_legacy_numa()tospapr_numa.cspapr_numa.c: createspapr_numa_initial_nvgpu_NUMA_id()helperspapr_numa.c: fix ibm,max-associativity-domains calculationhw/ppc/spapr.c | 21 ++------------------ hw/ppc/spapr_numa.c | 39 ++++++++++++++++++++++++++++++++++++- include/hw/ppc/spapr.h | 1 - include/hw/ppc/spapr_numa.h | 1 + 4 files changed, 41 insertions(+), 21 deletions(-)
Quoted 13 lines · Daniel Henrique Barboza
Quoted 10 lines · Greg Kurz
Quoted 6 lines · On Thu, 28 Jan 2021 12:17:28 -0300 Daniel Henrique Barboza…
Hi,
Patches 02 and 03 contain fixes for a problem Cedric found out when booting TCG guests with multiple NUMA nodes. See patch 03 commit message for more info.
Quoted 7 lines
Quoted 3 lines
This paragraph mentions "TCG guests", but I see nothing that is specific to TCG in these patches... so I expect the problem to also exists with KVM, right ?
Yeah. I mentioned TCG because this is the use case Cedric reproduced the bug with, but I myself had no problems reproducing it with accel=kvm as well.
I was also seeing the issue on KVM and I am still seeing it with this patchset. It's gone on TCG however.
C.
Cédric Le Goater
Tested-byQuoted 18 lines · Cédric Le Goater
Quoted 17 lines · Daniel Henrique Barboza
Quoted 13 lines · Greg Kurz
Quoted 6 lines · On Thu, 28 Jan 2021 12:17:28 -0300 Daniel Henrique Barboza…
Hi,
Patches 02 and 03 contain fixes for a problem Cedric found out when booting TCG guests with multiple NUMA nodes. See patch 03 commit message for more info.
This paragraph mentions "TCG guests", but I see nothing that is specific to TCG in these patches... so I expect the problem to also exists with KVM, right ?
Quoted 6 lines
Quoted 3 lines
Yeah. I mentioned TCG because this is the use case Cedric reproduced the bug with, but I myself had no problems reproducing it with accel=kvm as well.
I was also seeing the issue on KVM and I am still seeing it with this patchset. It's gone on TCG however.
ooups, sorry. All good on KVM also !
We can now safely use for_each_node() in the kernel.
Thanks Daniel,
C.