Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33223
b: refs/heads/master
c: 72f0b4e
h: refs/heads/master
i:
  33221: 42311bf
  33219: 15b6b1f
  33215: d8ddba9
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Aug 6, 2006
1 parent 98c8faa commit 6e5a9cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 927cbe8a3e9ebc466f76af5a5278a520dc2d5699
refs/heads/master: 72f0b4e2133ba1d65147d06016c0b6d2202235ca
10 changes: 6 additions & 4 deletions trunk/lib/spinlock_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ static void rwlock_bug(rwlock_t *lock, const char *msg)

#define RWLOCK_BUG_ON(cond, lock, msg) if (unlikely(cond)) rwlock_bug(lock, msg)

#if 0 /* __write_lock_debug() can lock up - maybe this can too? */
static void __read_lock_debug(rwlock_t *lock)
{
int print_once = 1;
Expand All @@ -184,12 +185,12 @@ static void __read_lock_debug(rwlock_t *lock)
}
}
}
#endif

void _raw_read_lock(rwlock_t *lock)
{
RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic");
if (unlikely(!__raw_read_trylock(&lock->raw_lock)))
__read_lock_debug(lock);
__raw_read_lock(&lock->raw_lock);
}

int _raw_read_trylock(rwlock_t *lock)
Expand Down Expand Up @@ -235,6 +236,7 @@ static inline void debug_write_unlock(rwlock_t *lock)
lock->owner_cpu = -1;
}

#if 0 /* This can cause lockups */
static void __write_lock_debug(rwlock_t *lock)
{
int print_once = 1;
Expand All @@ -257,12 +259,12 @@ static void __write_lock_debug(rwlock_t *lock)
}
}
}
#endif

void _raw_write_lock(rwlock_t *lock)
{
debug_write_lock_before(lock);
if (unlikely(!__raw_write_trylock(&lock->raw_lock)))
__write_lock_debug(lock);
__raw_write_lock(&lock->raw_lock);
debug_write_lock_after(lock);
}

Expand Down

0 comments on commit 6e5a9cc

Please sign in to comment.