Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/pic Don't send IPIs to ourselves if sending to ...



details:   https://anonhg.NetBSD.org/src/rev/d768d22dc170
branches:  trunk
changeset: 337345:d768d22dc170
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Apr 12 15:32:19 2015 +0000

description:
Don't send IPIs to ourselves if sending to everyone.

diffstat:

 sys/arch/arm/pic/pic.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r de6a339c44d2 -r d768d22dc170 sys/arch/arm/pic/pic.c
--- a/sys/arch/arm/pic/pic.c    Sun Apr 12 14:55:30 2015 +0000
+++ b/sys/arch/arm/pic/pic.c    Sun Apr 12 15:32:19 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pic.c,v 1.31 2015/04/12 08:55:14 matt Exp $    */
+/*     $NetBSD: pic.c,v 1.32 2015/04/12 15:32:19 matt Exp $    */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +33,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.31 2015/04/12 08:55:14 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.32 2015/04/12 15:32:19 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -164,6 +164,7 @@
 void
 intr_ipi_send(const kcpuset_t *kcp, u_long ipi)
 {
+       struct cpu_info * const ci = curcpu();
        KASSERT(ipi < NIPI);
        bool __diagused sent_p = false;
        for (size_t slot = 0; slot < PIC_MAXPICS; slot++) {
@@ -171,6 +172,10 @@
                if (pic == NULL || pic->pic_cpus == NULL)
                        continue;
                if (kcp == NULL || kcpuset_intersecting_p(kcp, pic->pic_cpus)) {
+                       // never send to ourself
+                       if (pic->pic_cpus == ci->ci_kcpuset)
+                               continue;
+
                        (*pic->pic_ops->pic_ipi_send)(pic, kcp, ipi);
                        // If we were targeting a single CPU or this pic
                        // handles all cpus, we're done.



Home | Main Index | Thread Index | Old Index