Hi, Peter,
On Tue, Jul 6, 2021 at 9:48 PM Peter Zijlstra [off-list ref] wrote:
On Tue, Jul 06, 2021 at 12:18:18PM +0800, Huacai Chen wrote:
quoted
+/*
+ * Loongson-3's SFB (Store-Fill-Buffer) may buffer writes indefinitely when a
+ * tight read loop is executed, because reads take priority over writes & the
+ * hardware (incorrectly) doesn't ensure that writes will eventually occur.
+ *
+ * Since spin loops of any kind should have a cpu_relax() in them, force an SFB
+ * flush from cpu_relax() such that any pending writes will become visible as
+ * expected.
+ */
+#define cpu_relax() smp_mb()
Guys! You've not fixed that utter trainwreck ?!? You've taped out a
whole new architecture and you're keeping this?
It is ugly of course, but it hasn't been fixed now.
Huacai