Author: vangyzen
Date: Tue Nov 13 20:48:05 2018
New Revision: 340409
URL: https://svnweb.freebsd.org/changeset/base/340409

Log:
  Make no assertions about lock state when the scheduler is stopped.
  
  Change the assert paths in rm, rw, and sx locks to match the lock
  and unlock paths.  I did this for mutexes in r306346.
  
  Reported by:  Travis Lane <tl...@isilon.com>
  MFC after:    2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/kern/kern_rmlock.c
  head/sys/kern/kern_rwlock.c
  head/sys/kern/kern_sx.c

Modified: head/sys/kern/kern_rmlock.c
==============================================================================
--- head/sys/kern/kern_rmlock.c Tue Nov 13 20:07:55 2018        (r340408)
+++ head/sys/kern/kern_rmlock.c Tue Nov 13 20:48:05 2018        (r340409)
@@ -742,7 +742,7 @@ _rm_assert(const struct rmlock *rm, int what, const ch
 {
        int count;
 
-       if (panicstr != NULL)
+       if (SCHEDULER_STOPPED())
                return;
        switch (what) {
        case RA_LOCKED:

Modified: head/sys/kern/kern_rwlock.c
==============================================================================
--- head/sys/kern/kern_rwlock.c Tue Nov 13 20:07:55 2018        (r340408)
+++ head/sys/kern/kern_rwlock.c Tue Nov 13 20:48:05 2018        (r340409)
@@ -1439,7 +1439,7 @@ __rw_assert(const volatile uintptr_t *c, int what, con
 {
        const struct rwlock *rw;
 
-       if (panicstr != NULL)
+       if (SCHEDULER_STOPPED())
                return;
 
        rw = rwlock2rw(c);

Modified: head/sys/kern/kern_sx.c
==============================================================================
--- head/sys/kern/kern_sx.c     Tue Nov 13 20:07:55 2018        (r340408)
+++ head/sys/kern/kern_sx.c     Tue Nov 13 20:48:05 2018        (r340409)
@@ -1416,7 +1416,7 @@ _sx_assert(const struct sx *sx, int what, const char *
        int slocked = 0;
 #endif
 
-       if (panicstr != NULL)
+       if (SCHEDULER_STOPPED())
                return;
        switch (what) {
        case SA_SLOCKED:
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to