Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Revert "kern: Sprinkle biglock-slippage assertions."



details:   https://anonhg.NetBSD.org/src/rev/221687a21900
branches:  trunk
changeset: 364582:221687a21900
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Mar 30 14:54:29 2022 +0000

description:
Revert "kern: Sprinkle biglock-slippage assertions."

Got the diagnostic information I needed from this, and it's holding
up releng tests of everything else, so let's back this out until I
need more diagnostics or track down the original source of the
problem.

diffstat:

 sys/kern/kern_softint.c |  12 ++----------
 sys/kern/kern_timeout.c |  10 +++-------
 sys/kern/vfs_bio.c      |   9 ++-------
 3 files changed, 7 insertions(+), 24 deletions(-)

diffs (130 lines):

diff -r a6e502643696 -r 221687a21900 sys/kern/kern_softint.c
--- a/sys/kern/kern_softint.c   Wed Mar 30 14:24:50 2022 +0000
+++ b/sys/kern/kern_softint.c   Wed Mar 30 14:54:29 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_softint.c,v 1.68 2022/03/30 10:34:14 riastradh Exp $      */
+/*     $NetBSD: kern_softint.c,v 1.69 2022/03/30 14:54:29 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2007, 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -170,7 +170,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.68 2022/03/30 10:34:14 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.69 2022/03/30 14:54:29 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -536,7 +536,6 @@
 {
        softint_t *si = l->l_private;
        softhand_t *sh;
-       int locks;
 
        KASSERT(si->si_lwp == curlwp);
        KASSERT(si->si_cpu == curcpu());
@@ -561,9 +560,6 @@
                sh->sh_flags ^= SOFTINT_PENDING;
                splx(s);
 
-               /* Record the kernel lock depth for diagnostics.  */
-               locks = curcpu()->ci_biglock_count;
-
                /* Run the handler. */
                if (__predict_true((sh->sh_flags & SOFTINT_MPSAFE) != 0)) {
                        (*sh->sh_func)(sh->sh_arg);
@@ -580,10 +576,6 @@
                /* Diagnostic: check that psrefs have not leaked. */
                KASSERTMSG(l->l_psrefs == 0, "%s: l_psrefs=%d, sh_func=%p\n",
                    __func__, l->l_psrefs, sh->sh_func);
-               /* Diagnostic: check that biglocks have not leaked. */
-               KASSERTMSG(locks == curcpu()->ci_biglock_count,
-                   "%s: sh_func=%p slipped %d->%d biglocks",
-                   __func__, sh->sh_func, locks, curcpu()->ci_biglock_count);
 
                (void)splhigh();
        }
diff -r a6e502643696 -r 221687a21900 sys/kern/kern_timeout.c
--- a/sys/kern/kern_timeout.c   Wed Mar 30 14:24:50 2022 +0000
+++ b/sys/kern/kern_timeout.c   Wed Mar 30 14:54:29 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_timeout.c,v 1.67 2022/03/30 10:34:14 riastradh Exp $      */
+/*     $NetBSD: kern_timeout.c,v 1.68 2022/03/30 14:54:29 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2003, 2006, 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_timeout.c,v 1.67 2022/03/30 10:34:14 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_timeout.c,v 1.68 2022/03/30 14:54:29 riastradh Exp $");
 
 /*
  * Timeouts are kept in a hierarchical timing wheel.  The c_time is the
@@ -740,7 +740,7 @@
        struct callout_cpu *cc;
        void (*func)(void *);
        void *arg;
-       int mpsafe, count, ticks, delta, locks;
+       int mpsafe, count, ticks, delta;
        lwp_t *l;
 
        l = curlwp;
@@ -776,7 +776,6 @@
                cc->cc_active = c;
 
                mutex_spin_exit(cc->cc_lock);
-               locks = curcpu()->ci_biglock_count;
                KASSERT(func != NULL);
                if (__predict_false(!mpsafe)) {
                        KERNEL_LOCK(1, NULL);
@@ -784,9 +783,6 @@
                        KERNEL_UNLOCK_ONE(NULL);
                } else
                        (*func)(arg);
-               KASSERTMSG(locks == curcpu()->ci_biglock_count,
-                   "callout %p func %p slipped %d->%d biglocks",
-                   c, func, locks, curcpu()->ci_biglock_count);
                mutex_spin_enter(cc->cc_lock);
 
                /*
diff -r a6e502643696 -r 221687a21900 sys/kern/vfs_bio.c
--- a/sys/kern/vfs_bio.c        Wed Mar 30 14:24:50 2022 +0000
+++ b/sys/kern/vfs_bio.c        Wed Mar 30 14:54:29 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_bio.c,v 1.302 2022/03/30 10:34:14 riastradh Exp $  */
+/*     $NetBSD: vfs_bio.c,v 1.303 2022/03/30 14:54:29 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2019, 2020 The NetBSD Foundation, Inc.
@@ -123,7 +123,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.302 2022/03/30 10:34:14 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.303 2022/03/30 14:54:29 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bufcache.h"
@@ -1673,7 +1673,6 @@
 biodone2(buf_t *bp)
 {
        void (*callout)(buf_t *);
-       int locks;
 
        SDT_PROBE1(io, kernel, ,done, bp);
 
@@ -1700,11 +1699,7 @@
                KASSERT(!cv_has_waiters(&bp->b_done));
                bp->b_iodone = NULL;
                mutex_exit(bp->b_objlock);
-               locks = curcpu()->ci_biglock_count;
                (*callout)(bp);
-               KASSERTMSG(locks == curcpu()->ci_biglock_count,
-                   "buf %p b_iodone %p slipped %d->%d biglocks",
-                   bp, callout, locks, curcpu()->ci_biglock_count);
        } else if (ISSET(bp->b_flags, B_ASYNC)) {
                /* If async, release. */
                BIOHIST_LOG(biohist, "async", 0, 0, 0, 0);



Home | Main Index | Thread Index | Old Index