[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190903093239.21278-5-hch@lst.de>
Date: Tue, 3 Sep 2019 11:32:23 +0200
From: Christoph Hellwig <hch@....de>
To: Palmer Dabbelt <palmer@...ive.com>,
Paul Walmsley <paul.walmsley@...ive.com>
Cc: Damien Le Moal <damien.lemoal@....com>,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
Atish Patra <atish.patra@....com>
Subject: [PATCH 04/20] riscv: optimize send_ipi_single
Don't go through send_ipi_mask, but just set the op bit an then pass a
simple generate hartid mask directly to sbi_send_ipi.
Signed-off-by: Christoph Hellwig <hch@....de>
Reviewed-by: Atish Patra <atish.patra@....com>
---
arch/riscv/kernel/smp.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
index 2e21669aa068..a3715d621f60 100644
--- a/arch/riscv/kernel/smp.c
+++ b/arch/riscv/kernel/smp.c
@@ -94,7 +94,13 @@ static void send_ipi_mask(const struct cpumask *mask, enum ipi_message_type op)
static void send_ipi_single(int cpu, enum ipi_message_type op)
{
- send_ipi_mask(cpumask_of(cpu), op);
+ int hartid = cpuid_to_hartid_map(cpu);
+
+ smp_mb__before_atomic();
+ set_bit(op, &ipi_data[cpu].bits);
+ smp_mb__after_atomic();
+
+ sbi_send_ipi(cpumask_bits(cpumask_of(hartid)));
}
static inline void clear_ipi(void)
--
2.20.1
Powered by blists - more mailing lists