All the LMB from the same set of ibm,dynamic-memory-v2 property are
sharing the same NUMA node. Don't compute that node for each one.
Tested on a system with 1022 LMBs spread on 4 NUMA nodes, only 4 calls to
lmb_set_nid() have been made instead of 1022.
This should prevent some soft lockups when starting large guests
Signed-off-by: Laurent Dufour <redacted>
---
arch/powerpc/mm/drmem.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
@@ -422,10 +422,18 @@ static void __init init_drmem_v2_lmbs(const __be32 *prop)/* second pass, read in the LMB information */lmb_index=0;p=prop;+first=NULL;for(i=0;i<lmb_sets;i++){read_drconf_v2_cell(&dr_cell,&p);+/*+*FetchtheNUMAnodeidforthefistsetorifthe+*associativityindexisdifferentfromthepreviousset.+*/+if(first&&dr_cell.aa_index!=first->aa_index)+first=NULL;+for(j=0;j<dr_cell.seq_lmbs;j++){lmb=&drmem_info->lmbs[lmb_index++];
All the LMB from the same set of ibm,dynamic-memory-v2 property are
sharing the same NUMA node. Don't compute that node for each one.
Tested on a system with 1022 LMBs spread on 4 NUMA nodes, only 4 calls to
lmb_set_nid() have been made instead of 1022.
This should prevent some soft lockups when starting large guests
Code has meaning only if CONFIG_MEMORY_HOTPLUG is set, otherwise the nid
field is not present in the drmem_lmb structure.
Signed-off-by: Laurent Dufour <redacted>
---
arch/powerpc/mm/drmem.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
All the LMB from the same set of ibm,dynamic-memory-v2 property are
sharing the same NUMA node. Don't compute that node for each one.
Tested on a system with 1022 LMBs spread on 4 NUMA nodes, only 4 calls to
lmb_set_nid() have been made instead of 1022.
This should prevent some soft lockups when starting large guests
Code has meaning only if CONFIG_MEMORY_HOTPLUG is set, otherwise the nid
field is not present in the drmem_lmb structure.
Signed-off-by: Laurent Dufour <redacted>
It looks like this patch was superseded by e5e179aa3a39 ("pseries/drmem:
don't cache node id in drmem_lmb struct").
If not, anyway it conflicts with that patch so it has to be rebased.
Thanks
Christophe
All the LMB from the same set of ibm,dynamic-memory-v2 property are
sharing the same NUMA node. Don't compute that node for each one.
Tested on a system with 1022 LMBs spread on 4 NUMA nodes, only 4 calls to
lmb_set_nid() have been made instead of 1022.
This should prevent some soft lockups when starting large guests
Code has meaning only if CONFIG_MEMORY_HOTPLUG is set, otherwise the nid
field is not present in the drmem_lmb structure.
Signed-off-by: Laurent Dufour <redacted>
It looks like this patch was superseded by e5e179aa3a39 ("pseries/drmem:
don't cache node id in drmem_lmb struct").
That patch has been superseded and can be dropped.
Thanks,
Laurent.
If not, anyway it conflicts with that patch so it has to be rebased.
Thanks
Christophe
*prop)
for (i = 0; i < lmb_sets; i++) {
read_drconf_v2_cell(&dr_cell, &p);
+#ifdef CONFIG_MEMORY_HOTPLUG
+ /*
+ * Fetch the NUMA node id for the fist set or if the
+ * associativity index is different from the previous set.
+ */
+ if (first && dr_cell.aa_index != first->aa_index)
+ first = NULL;
+#endif
+
for (j = 0; j < dr_cell.seq_lmbs; j++) {
lmb = &drmem_info->lmbs[lmb_index++];
@@ -438,7 +450,18 @@ static void __init init_drmem_v2_lmbs(const __be32
*prop)
lmb->aa_index = dr_cell.aa_index;
lmb->flags = dr_cell.flags;
- lmb_set_nid(lmb);
+#ifdef CONFIG_MEMORY_HOTPLUG
+ /*
+ * All the LMB in the set share the same NUMA
+ * associativity property. So read that node only once.
+ */
+ if (!first) {
+ lmb_set_nid(lmb);
+ first = lmb;
+ } else {
+ lmb->nid = first->nid;
+ }
+#endif
}
}
}