All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Do not issue remote fences until smp is available
@ 2022-10-28 23:19 ` Atish Patra
  0 siblings, 0 replies; 10+ messages in thread
From: Atish Patra @ 2022-10-28 23:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Atish Patra, Albert Ou, Atish Patra, Anup Patel, Damien Le Moal,
	devicetree, Jisheng Zhang, Krzysztof Kozlowski, linux-riscv,
	Palmer Dabbelt, Paul Walmsley, Rob Herring

It is useless to issue remote fences if there is a single core
available. It becomes a bottleneck for sbi based rfences where
we will be making those ECALLs for no reason. Early code patching
because of static calls end up in this path.

Signed-off-by: Atish Patra <atishp@rivosinc.com>
---
 arch/riscv/mm/cacheflush.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/riscv/mm/cacheflush.c b/arch/riscv/mm/cacheflush.c
index f10cb47eac3a..7fafc8c26505 100644
--- a/arch/riscv/mm/cacheflush.c
+++ b/arch/riscv/mm/cacheflush.c
@@ -19,6 +19,10 @@ void flush_icache_all(void)
 {
 	local_flush_icache_all();
 
+	/* No need to issue remote fence if only 1 cpu is online */
+	if (num_online_cpus() == 1)
+		return;
+
 	if (IS_ENABLED(CONFIG_RISCV_SBI) && !riscv_use_ipi_for_rfence())
 		sbi_remote_fence_i(NULL);
 	else
-- 
2.34.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-11-12  7:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-28 23:19 [PATCH] RISC-V: Do not issue remote fences until smp is available Atish Patra
2022-10-28 23:19 ` Atish Patra
2022-10-31 19:11 ` Conor Dooley
2022-10-31 19:11   ` Conor Dooley
2022-10-31 19:26   ` Atish Patra
2022-10-31 19:26     ` Atish Patra
2022-11-10 21:42     ` Palmer Dabbelt
2022-11-10 21:42       ` Palmer Dabbelt
2022-11-12  7:46       ` Atish Patra
2022-11-12  7:46         ` Atish Patra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.