[Skiboot] [PATCH v2 47/59] xive/p10: Change alignment of the queue overflow pages

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Wed Aug 4 17:21:25 AEST 2021


From: Cédric Le Goater <clg at kaod.org>

The Memory Coherence Directory uses 16M "granule" to track shared
copies of a cache line. If any cache line within the 16M range gets
touched by someone outside of the group, the MCD forces accesses to
any cache line within the range to include everyone that might have a
shared copy.

Allocate the queue overflow pages and use a 16M alignment to avoid
sharing with other structures and reduce traffic on the PowerBus.

Signed-off-by: Cédric Le Goater <clg at kaod.org>
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 hw/xive2.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/hw/xive2.c b/hw/xive2.c
index 56b02fc67..a7b45a005 100644
--- a/hw/xive2.c
+++ b/hw/xive2.c
@@ -1492,6 +1492,8 @@ static bool xive_configure_bars(struct xive *x)
 	xive_dbg(x, "NVP: %14p [0x%012llx]\n", x->nvp_base, x->nvp_size);
 	xive_dbg(x, "ESB: %14p [0x%012llx]\n", x->esb_base, x->esb_size);
 	xive_dbg(x, "END: %14p [0x%012llx]\n", x->end_base, x->end_size);
+	xive_dbg(x, "OVF: %14p [0x%012x]\n", x->q_ovf,
+		 VC_QUEUE_COUNT * PAGE_SIZE);
 
 	return true;
 }
@@ -1898,8 +1900,22 @@ static bool xive_prealloc_tables(struct xive *x)
 		return false;
 	}
 
-	/* Allocate the queue overflow pages */
-	x->q_ovf = local_alloc(x->chip_id, VC_QUEUE_COUNT * PAGE_SIZE, PAGE_SIZE);
+	/*
+	 * The Memory Coherence Directory uses 16M "granule" to track
+	 * shared copies of a cache line. If any cache line within the
+	 * 16M range gets touched by someone outside of the group, the
+	 * MCD forces accesses to any cache line within the range to
+	 * include everyone that might have a shared copy.
+	 */
+#define QUEUE_OVF_ALIGN (16 << 20) /* MCD granule size */
+
+	/*
+	 * Allocate the queue overflow pages and use a 16M alignment
+	 * to avoid sharing with other structures and reduce traffic
+	 * on the PowerBus.
+	 */
+	x->q_ovf = local_alloc(x->chip_id, VC_QUEUE_COUNT * PAGE_SIZE,
+			       QUEUE_OVF_ALIGN);
 	if (!x->q_ovf) {
 		xive_err(x, "Failed to allocate queue overflow\n");
 		return false;
-- 
2.31.1



More information about the Skiboot mailing list