Source-Changes-HG archive

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

[src/trunk]: src/sys Revert change that allowed rw_tryenter(&lock, RW_READER)...



details:   https://anonhg.NetBSD.org/src/rev/403771fdde2d
branches:  trunk
changeset: 786352:403771fdde2d
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Apr 27 08:12:34 2013 +0000

description:
Revert change that allowed rw_tryenter(&lock, RW_READER) to recurse
for vfs_busy(). This is no longer necessary.

diffstat:

 sys/kern/kern_lock.c      |   6 +++---
 sys/kern/kern_mutex.c     |   6 +++---
 sys/kern/kern_rwlock.c    |  18 +++++++++---------
 sys/kern/subr_lockdebug.c |   9 ++++-----
 sys/sys/lockdebug.h       |  10 +++++-----
 5 files changed, 24 insertions(+), 25 deletions(-)

diffs (204 lines):

diff -r ac12d2cf0de3 -r 403771fdde2d sys/kern/kern_lock.c
--- a/sys/kern/kern_lock.c      Sat Apr 27 08:03:02 2013 +0000
+++ b/sys/kern/kern_lock.c      Sat Apr 27 08:12:34 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_lock.c,v 1.153 2012/08/30 02:23:14 matt Exp $     */
+/*     $NetBSD: kern_lock.c,v 1.154 2013/04/27 08:12:34 mlelstv Exp $  */
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.153 2012/08/30 02:23:14 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.154 2013/04/27 08:12:34 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -175,7 +175,7 @@
 
        _KERNEL_LOCK_ASSERT(l->l_blcnt == 0);
        LOCKDEBUG_WANTLOCK(kernel_lock_dodebug, kernel_lock, RETURN_ADDRESS,
-           false, false);
+           0);
 
        if (__cpu_simple_lock_try(kernel_lock)) {
                ci->ci_biglock_count = nlocks;
diff -r ac12d2cf0de3 -r 403771fdde2d sys/kern/kern_mutex.c
--- a/sys/kern/kern_mutex.c     Sat Apr 27 08:03:02 2013 +0000
+++ b/sys/kern/kern_mutex.c     Sat Apr 27 08:12:34 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_mutex.c,v 1.53 2012/02/25 22:32:44 rmind Exp $    */
+/*     $NetBSD: kern_mutex.c,v 1.54 2013/04/27 08:12:34 mlelstv Exp $  */
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define        __MUTEX_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.53 2012/02/25 22:32:44 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.54 2013/04/27 08:12:34 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -74,7 +74,7 @@
 
 #define        MUTEX_WANTLOCK(mtx)                                     \
     LOCKDEBUG_WANTLOCK(MUTEX_DEBUG_P(mtx), (mtx),              \
-        (uintptr_t)__builtin_return_address(0), false, false)
+        (uintptr_t)__builtin_return_address(0), 0)
 #define        MUTEX_LOCKED(mtx)                                       \
     LOCKDEBUG_LOCKED(MUTEX_DEBUG_P(mtx), (mtx), NULL,          \
         (uintptr_t)__builtin_return_address(0), 0)
diff -r ac12d2cf0de3 -r 403771fdde2d sys/kern/kern_rwlock.c
--- a/sys/kern/kern_rwlock.c    Sat Apr 27 08:03:02 2013 +0000
+++ b/sys/kern/kern_rwlock.c    Sat Apr 27 08:12:34 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_rwlock.c,v 1.39 2012/12/12 14:53:01 yamt Exp $    */
+/*     $NetBSD: kern_rwlock.c,v 1.40 2013/04/27 08:12:35 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.39 2012/12/12 14:53:01 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.40 2013/04/27 08:12:35 mlelstv Exp $");
 
 #define        __RWLOCK_PRIVATE
 
@@ -61,9 +61,9 @@
 
 #if defined(LOCKDEBUG)
 
-#define        RW_WANTLOCK(rw, op, t)                                          \
+#define        RW_WANTLOCK(rw, op)                                             \
        LOCKDEBUG_WANTLOCK(RW_DEBUG_P(rw), (rw),                        \
-           (uintptr_t)__builtin_return_address(0), op == RW_READER, t);
+           (uintptr_t)__builtin_return_address(0), op == RW_READER);
 #define        RW_LOCKED(rw, op)                                               \
        LOCKDEBUG_LOCKED(RW_DEBUG_P(rw), (rw), NULL,                    \
            (uintptr_t)__builtin_return_address(0), op == RW_READER);
@@ -78,7 +78,7 @@
 
 #else  /* LOCKDEBUG */
 
-#define        RW_WANTLOCK(rw, op, t)  /* nothing */
+#define        RW_WANTLOCK(rw, op)     /* nothing */
 #define        RW_LOCKED(rw, op)       /* nothing */
 #define        RW_UNLOCKED(rw, op)     /* nothing */
 #define        RW_DASSERT(rw, cond)    /* nothing */
@@ -281,7 +281,7 @@
 
        RW_ASSERT(rw, !cpu_intr_p());
        RW_ASSERT(rw, curthread != 0);
-       RW_WANTLOCK(rw, op, false);
+       RW_WANTLOCK(rw, op);
 
        if (panicstr == NULL) {
                LOCKDEBUG_BARRIER(&kernel_lock, 1);
@@ -555,7 +555,7 @@
                }
        }
 
-       RW_WANTLOCK(rw, op, true);
+       RW_WANTLOCK(rw, op);
        RW_LOCKED(rw, op);
        RW_DASSERT(rw, (op != RW_READER && RW_OWNER(rw) == curthread) ||
            (op == RW_READER && RW_COUNT(rw) != 0));
@@ -647,7 +647,7 @@
                }
        }
 
-       RW_WANTLOCK(rw, RW_READER, false);
+       RW_WANTLOCK(rw, RW_READER);
        RW_LOCKED(rw, RW_READER);
        RW_DASSERT(rw, (rw->rw_owner & RW_WRITE_LOCKED) == 0);
        RW_DASSERT(rw, RW_COUNT(rw) != 0);
@@ -683,7 +683,7 @@
        }
 
        RW_UNLOCKED(rw, RW_READER);
-       RW_WANTLOCK(rw, RW_WRITER, true);
+       RW_WANTLOCK(rw, RW_WRITER);
        RW_LOCKED(rw, RW_WRITER);
        RW_DASSERT(rw, rw->rw_owner & RW_WRITE_LOCKED);
        RW_DASSERT(rw, RW_OWNER(rw) == curthread);
diff -r ac12d2cf0de3 -r 403771fdde2d sys/kern/subr_lockdebug.c
--- a/sys/kern/subr_lockdebug.c Sat Apr 27 08:03:02 2013 +0000
+++ b/sys/kern/subr_lockdebug.c Sat Apr 27 08:12:34 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_lockdebug.c,v 1.48 2013/02/09 11:04:32 njoly Exp $        */
+/*     $NetBSD: subr_lockdebug.c,v 1.49 2013/04/27 08:12:35 mlelstv Exp $      */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.48 2013/02/09 11:04:32 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.49 2013/04/27 08:12:35 mlelstv Exp $");
 
 #include "opt_ddb.h"
 
@@ -411,8 +411,7 @@
  *     Process the preamble to a lock acquire.
  */
 void
-lockdebug_wantlock(volatile void *lock, uintptr_t where, bool shared,
-                  bool trylock)
+lockdebug_wantlock(volatile void *lock, uintptr_t where, int shared)
 {
        struct lwp *l = curlwp;
        lockdebug_t *ld;
@@ -432,7 +431,7 @@
        }
        if ((ld->ld_flags & LD_LOCKED) != 0 || ld->ld_shares != 0) {
                if ((ld->ld_flags & LD_SLEEPER) != 0) {
-                       if (ld->ld_lwp == l && !(shared && trylock))
+                       if (ld->ld_lwp == l)
                                recurse = true;
                } else if (ld->ld_cpu == (uint16_t)cpu_index(curcpu()))
                        recurse = true;
diff -r ac12d2cf0de3 -r 403771fdde2d sys/sys/lockdebug.h
--- a/sys/sys/lockdebug.h       Sat Apr 27 08:03:02 2013 +0000
+++ b/sys/sys/lockdebug.h       Sat Apr 27 08:12:34 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lockdebug.h,v 1.13 2011/11/21 04:36:05 christos Exp $  */
+/*     $NetBSD: lockdebug.h,v 1.14 2013/04/27 08:12:34 mlelstv Exp $   */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 bool   lockdebug_alloc(volatile void *, lockops_t *, uintptr_t);
 void   lockdebug_free(volatile void *);
-void   lockdebug_wantlock(volatile void *, uintptr_t, bool, bool);
+void   lockdebug_wantlock(volatile void *, uintptr_t, int);
 void   lockdebug_locked(volatile void *, void *, uintptr_t, int);
 void   lockdebug_unlocked(volatile void *, uintptr_t, int);
 void   lockdebug_barrier(volatile void *, int);
@@ -72,8 +72,8 @@
 #define        LOCKDEBUG_ALLOC(lock, ops, addr)        lockdebug_alloc(lock, ops, addr)
 #define        LOCKDEBUG_FREE(dodebug, lock) \
     if (dodebug) lockdebug_free(lock)
-#define        LOCKDEBUG_WANTLOCK(dodebug, lock, where, s, t) \
-    if (dodebug) lockdebug_wantlock(lock, where, s, t)
+#define        LOCKDEBUG_WANTLOCK(dodebug, lock, where, s) \
+    if (dodebug) lockdebug_wantlock(lock, where, s)
 #define        LOCKDEBUG_LOCKED(dodebug, lock, al, where, s) \
     if (dodebug) lockdebug_locked(lock, al, where, s)
 #define        LOCKDEBUG_UNLOCKED(dodebug, lock, where, s) \
@@ -88,7 +88,7 @@
 
 #define        LOCKDEBUG_ALLOC(lock, ops, addr)                false
 #define        LOCKDEBUG_FREE(dodebug, lock)                   /* nothing */
-#define        LOCKDEBUG_WANTLOCK(dodebug, lock, where, s, t)  /* nothing */
+#define        LOCKDEBUG_WANTLOCK(dodebug, lock, where, s)     /* nothing */
 #define        LOCKDEBUG_LOCKED(dodebug, lock, al, where, s)   /* nothing */
 #define        LOCKDEBUG_UNLOCKED(dodebug, lock, where, s)     /* nothing */
 #define        LOCKDEBUG_BARRIER(lock, slp)                    /* nothing */



Home | Main Index | Thread Index | Old Index