[Skiboot] [PATCH 1/4] xive/p9: Use local_alloc() to allocate the XIVE bitmaps

Cédric Le Goater clg at kaod.org
Thu Nov 5 09:20:54 AEDT 2020


These bitmaps are big (128K). On systems with multiple sockets, we
will run out of heap.

Signed-off-by: Cédric Le Goater <clg at kaod.org>
---
 hw/xive.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/hw/xive.c b/hw/xive.c
index c1786f288c90..34e211c3bf1a 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -2636,15 +2636,19 @@ static struct xive *init_one_xive(struct dt_node *np)
 		x->int_ipi_top = XIVE_INT_FIRST;
 
 	/* Allocate a few bitmaps */
-	x->eq_map = zalloc(BITMAP_BYTES(XIVE_EQ_COUNT >> 3));
+	x->eq_map = local_alloc(x->chip_id, BITMAP_BYTES(XIVE_EQ_COUNT >> 3), PAGE_SIZE);
 	assert(x->eq_map);
+	memset(x->eq_map, 0, BITMAP_BYTES(XIVE_EQ_COUNT >> 3));
+
 	/* Make sure we don't hand out 0 */
 	bitmap_set_bit(*x->eq_map, 0);
 
-	x->int_enabled_map = zalloc(BITMAP_BYTES(XIVE_INT_COUNT));
+	x->int_enabled_map = local_alloc(x->chip_id, BITMAP_BYTES(XIVE_INT_COUNT), PAGE_SIZE);
 	assert(x->int_enabled_map);
-	x->ipi_alloc_map = zalloc(BITMAP_BYTES(XIVE_INT_COUNT));
+	memset(x->int_enabled_map, 0, BITMAP_BYTES(XIVE_INT_COUNT));
+	x->ipi_alloc_map = local_alloc(x->chip_id, BITMAP_BYTES(XIVE_INT_COUNT), PAGE_SIZE);
 	assert(x->ipi_alloc_map);
+	memset(x->ipi_alloc_map, 0, BITMAP_BYTES(XIVE_INT_COUNT));
 
 	xive_dbg(x, "Handling interrupts [%08x..%08x]\n",
 		 x->int_base, x->int_max - 1);
-- 
2.26.2



More information about the Skiboot mailing list