Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 x86: Omit needless membar_sync in intr_dise...



details:   https://anonhg.NetBSD.org/src/rev/c132129ddf6a
branches:  trunk
changeset: 374225:c132129ddf6a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Apr 11 13:11:01 2023 +0000

description:
x86: Omit needless membar_sync in intr_disestablish_xcall.

Details in comments.

diffstat:

 sys/arch/x86/x86/intr.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r 65b1125f0797 -r c132129ddf6a sys/arch/x86/x86/intr.c
--- a/sys/arch/x86/x86/intr.c   Tue Apr 11 13:06:21 2023 +0000
+++ b/sys/arch/x86/x86/intr.c   Tue Apr 11 13:11:01 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.c,v 1.164 2023/01/25 15:54:53 riastradh Exp $     */
+/*     $NetBSD: intr.c,v 1.165 2023/04/11 13:11:01 riastradh Exp $     */
 
 /*
  * Copyright (c) 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.164 2023/01/25 15:54:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.165 2023/04/11 13:11:01 riastradh Exp $");
 
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
@@ -1164,9 +1164,13 @@ intr_disestablish_xcall(void *arg1, void
        idtvec = source->is_idtvec;
 
        (*pic->pic_hwmask)(pic, ih->ih_pin);
-       membar_sync();
+
+       /*
+        * ci_pending is stable on the current CPU while interrupts are
+        * blocked, and we only need to synchronize with interrupt
+        * vectors on the same CPU, so no need for atomics or membars.
+        */
        ci->ci_ipending &= ~(1ULL << ih->ih_slot);
-       membar_sync();
 
        /*
         * Remove the handler from the chain.



Home | Main Index | Thread Index | Old Index