Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Make the fast path in xc_wait() depend on _LP64 for...



details:   https://anonhg.NetBSD.org/src/rev/a1335d858b58
branches:  trunk
changeset: 846787:a1335d858b58
user:      ad <ad%NetBSD.org@localhost>
date:      Sun Dec 01 16:32:01 2019 +0000

description:
Make the fast path in xc_wait() depend on _LP64 for now.  Needs 64-bit
load/store.  To be revisited.

diffstat:

 sys/kern/subr_xcall.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r e44fec517d3d -r a1335d858b58 sys/kern/subr_xcall.c
--- a/sys/kern/subr_xcall.c     Sun Dec 01 16:22:10 2019 +0000
+++ b/sys/kern/subr_xcall.c     Sun Dec 01 16:32:01 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_xcall.c,v 1.29 2019/12/01 14:20:00 ad Exp $       */
+/*     $NetBSD: subr_xcall.c,v 1.30 2019/12/01 16:32:01 ad Exp $       */
 
 /*-
  * Copyright (c) 2007-2010, 2019 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_xcall.c,v 1.29 2019/12/01 14:20:00 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_xcall.c,v 1.30 2019/12/01 16:32:01 ad Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -354,15 +354,19 @@
        }
 
        /* Block until awoken. */
+#ifdef _LP64                   /* Needs 64-bit load/store for atomicity. */
        if (xc->xc_donep < where) {
+#endif
                mutex_enter(&xc->xc_lock);
                while (xc->xc_donep < where) {
                        cv_wait(&xc->xc_busy, &xc->xc_lock);
                }
                mutex_exit(&xc->xc_lock);
+#ifdef _LP64
        } else {
                membar_enter();
        }
+#endif
 }
 
 /*



Home | Main Index | Thread Index | Old Index