]> Pileus Git - ~andy/linux/commitdiff
s390/smp: only send external call ipi if needed
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 3 Dec 2013 09:06:29 +0000 (10:06 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 16 Dec 2013 13:37:43 +0000 (14:37 +0100)
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 <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/smp.c

index dc4a534650604a972967ab5dedd2c1b7155c29ad..86b291323c62b6e9988effc976120d7cfa11a046 100644 (file)
@@ -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);
 }