Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Revert unintentional changes to kern_lock.c in prev...



details:   https://anonhg.NetBSD.org/src/rev/d263f0037216
branches:  trunk
changeset: 377330:d263f0037216
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Jul 07 18:02:52 2023 +0000

description:
Revert unintentional changes to kern_lock.c in previous commit.

diffstat:

 sys/kern/kern_lock.c |  25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diffs (89 lines):

diff -r 81ad257b8a8f -r d263f0037216 sys/kern/kern_lock.c
--- a/sys/kern/kern_lock.c      Fri Jul 07 17:05:13 2023 +0000
+++ b/sys/kern/kern_lock.c      Fri Jul 07 18:02:52 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_lock.c,v 1.185 2023/07/07 17:05:13 riastradh Exp $        */
+/*     $NetBSD: kern_lock.c,v 1.186 2023/07/07 18:02:52 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2020 The NetBSD Foundation, Inc.
@@ -31,10 +31,9 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.185 2023/07/07 17:05:13 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.186 2023/07/07 18:02:52 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
-#include "opt_ddb.h"
 #include "opt_lockdebug.h"
 #endif
 
@@ -54,10 +53,6 @@
 #include <sys/ksyms.h>
 #endif
 
-#ifdef DDB
-#include <ddb/ddb.h>
-#endif
-
 #include <machine/lock.h>
 
 #include <dev/lockstat.h>
@@ -121,17 +116,17 @@ panic:    panic("%s: %s caller=%p", __func_
  * so that they show up in profiles.
  */
 
-#ifdef LOCKDEBUG
 #define        _KERNEL_LOCK_ABORT(msg)                                         \
     LOCKDEBUG_ABORT(__func__, __LINE__, kernel_lock, &_kernel_lock_ops, msg)
+
+#ifdef LOCKDEBUG
 #define        _KERNEL_LOCK_ASSERT(cond)                                       \
 do {                                                                   \
        if (!(cond))                                                    \
                _KERNEL_LOCK_ABORT("assertion failed: " #cond);         \
 } while (/* CONSTCOND */ 0)
 #else
-#define        _KERNEL_LOCK_ABORT(cond)        __nothing
-#define        _KERNEL_LOCK_ASSERT(cond)       __nothing
+#define        _KERNEL_LOCK_ASSERT(cond)       /* nothing */
 #endif
 
 static void    _kernel_lock_dump(const volatile void *, lockop_printer_t);
@@ -142,6 +137,10 @@ lockops_t _kernel_lock_ops = {
        .lo_dump = _kernel_lock_dump,
 };
 
+#ifdef LOCKDEBUG
+
+#include <ddb/ddb.h>
+
 static void
 kernel_lock_trace_ipi(void *cookie)
 {
@@ -149,10 +148,10 @@ kernel_lock_trace_ipi(void *cookie)
        printf("%s[%d %s]: hogging kernel lock\n", cpu_name(curcpu()),
            curlwp->l_lid,
            curlwp->l_name ? curlwp->l_name : curproc->p_comm);
-#ifdef DDB
        db_stacktrace();
+}
+
 #endif
-}
 
 /*
  * Initialize the kernel lock.
@@ -196,9 +195,11 @@ void
        LOCKSTAT_TIMER(spintime);
        LOCKSTAT_FLAG(lsflag);
        struct lwp *owant;
+#ifdef LOCKDEBUG
        static struct cpu_info *kernel_lock_holder;
        u_int spins = 0;
        u_int starttime = getticks();
+#endif
        int s;
        struct lwp *l = curlwp;
 



Home | Main Index | Thread Index | Old Index