RE: [PATCH v2 7/7] x86/resctrl: Determine if Sub-NUMA Cluster is enabled and initialize.

From: Luck, Tony
Date: Thu Jun 22 2023 - 12:02:09 EST


> Unfortunately I'm not getting as good of results with the new series.
> The main difference seems to be updating the 0xca0 MSR instead of
> applying the offset to PQR_ASSOC.

I think I may have reversed the actions to update the MSR in one of
my refactor/rebase. The comment here is correct, but that's not
what the code is doing :-(

Can you swap the bodies of these two functions and retest?

+/*
+ * This MSR provides for configuration of RMIDs on Sub-NUMA Cluster
+ * systems.
+ * Bit0 = 1 (default) For legacy configuration
+ * Bit0 = 0 RMIDs are divided evenly between SNC nodes.
+ */
+#define MSR_RMID_SNC_CONFIG 0xCA0
+
+static void snc_add_pkg(void)
+{
+ u64 msrval;
+
+ rdmsrl(MSR_RMID_SNC_CONFIG, msrval);
+ msrval |= BIT_ULL(0);
+ wrmsrl(MSR_RMID_SNC_CONFIG, msrval);
+}
+
+static void snc_remove_pkg(void)
+{
+ u64 msrval;
+
+ rdmsrl(MSR_RMID_SNC_CONFIG, msrval);
+ msrval &= ~BIT_ULL(0);
+ wrmsrl(MSR_RMID_SNC_CONFIG, msrval);
+}

-Tony