Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha/alpha alpha: Convert ipifuncs.c to membar_rel...



details:   https://anonhg.NetBSD.org/src/rev/6b4dab534fb1
branches:  trunk
changeset: 365155:6b4dab534fb1
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Apr 09 23:42:56 2022 +0000

description:
alpha: Convert ipifuncs.c to membar_release/acquire.

No semantic change is possible because all of these membars are just
mb on alpha -- change just makes the intent clearer.  (Only
membar_producer is weaker, wmb.)

diffstat:

 sys/arch/alpha/alpha/ipifuncs.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (43 lines):

diff -r 9524896f9132 -r 6b4dab534fb1 sys/arch/alpha/alpha/ipifuncs.c
--- a/sys/arch/alpha/alpha/ipifuncs.c   Sat Apr 09 23:41:22 2022 +0000
+++ b/sys/arch/alpha/alpha/ipifuncs.c   Sat Apr 09 23:42:56 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipifuncs.c,v 1.54 2020/10/10 03:05:04 thorpej Exp $ */
+/* $NetBSD: ipifuncs.c,v 1.55 2022/04/09 23:42:56 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.54 2020/10/10 03:05:04 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.55 2022/04/09 23:42:56 riastradh Exp $");
 
 /*
  * Interprocessor interrupt handlers.
@@ -127,10 +127,12 @@
 
        while ((pending_ipis = atomic_swap_ulong(&ci->ci_ipis, 0)) != 0) {
                /*
-                * Ensure the atomic swap is globally visible before
-                * we do any of the work.
+                * Ensure everything prior to setting ci_ipis in
+                * alpha_send_ipi happens-before everything after
+                * reading ci_ipis here so we're not working on stale
+                * inputs.
                 */
-               membar_enter();
+               membar_acquire();
 
                sc->sc_evcnt_ipi.ev_count++;
 
@@ -159,7 +161,7 @@
         * alpha_send_ipi() have completed before informing
         * the CPU of the work we are asking it to do.
         */
-       membar_exit();
+       membar_release();
        atomic_or_ulong(&cpu_info[cpu_id]->ci_ipis, ipimask);
 
        /*



Home | Main Index | Thread Index | Old Index