]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
riscv: optimize send_ipi_single
authorChristoph Hellwig <hch@lst.de>
Wed, 21 Aug 2019 14:58:34 +0000 (23:58 +0900)
committerPaul Walmsley <paul.walmsley@sifive.com>
Thu, 5 Sep 2019 08:46:21 +0000 (01:46 -0700)
Don't go through send_ipi_mask, but just set the op bit and then pass
a simple generated hartid mask directly to sbi_send_ipi.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
[paul.walmsley@sifive.com: minor patch description fixes]
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
arch/riscv/kernel/smp.c

index 2e21669aa06844dfb3c4e1d37513150d6442f8ea..a3715d621f60ca7f3e4e56c6b7b2a10a64182f80 100644 (file)
@@ -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)