From dea24190fbfb340dea5224e32161955514bef31b Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Tue, 3 Dec 2013 10:06:29 +0100 Subject: s390/smp: only send external call ipi if needed If the per cpu ec_mask bit of the receiving cpu is already set there is no need to send an ipi, since a different cpu has already sent an ipi and the receiving cpu has not yet executed the external call ipi handler. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index dc4a534..86b2913 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -159,9 +159,9 @@ static void pcpu_ec_call(struct pcpu *pcpu, int ec_bit) { int order; - set_bit(ec_bit, &pcpu->ec_mask); - order = pcpu_running(pcpu) ? - SIGP_EXTERNAL_CALL : SIGP_EMERGENCY_SIGNAL; + if (test_and_set_bit(ec_bit, &pcpu->ec_mask)) + return; + order = pcpu_running(pcpu) ? SIGP_EXTERNAL_CALL : SIGP_EMERGENCY_SIGNAL; pcpu_sigp_retry(pcpu, order, 0); } -- cgit v0.10.2