diff options
author | Ivan Kokshaysky <ink@jurassic.park.msu.ru> | 2004-04-27 19:58:52 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-04-27 19:58:52 -0700 |
commit | 533a071fbc819080f1e70da2ef99337d26912a74 (patch) | |
tree | ca1d82dd43b99094d0a43a97ef38722522d783d6 /lib | |
parent | c631700d2d729980137611b32d6b56723d1d57e5 (diff) | |
download | history-533a071fbc819080f1e70da2ef99337d26912a74.tar.gz |
[PATCH] Fix rwsem contention case on alpha/s390x
Thanks to Dru <andru@treshna.com>, who provided an easy way to reproduce
the problem.
What we have in lib/rwsem.c:__rwsem_do_wake():
int woken, loop;
^^^
and several lines below:
loop = woken;
woken *= RWSEM_ACTIVE_BIAS-RWSEM_WAITING_BIAS;
woken -= RWSEM_ACTIVE_BIAS;
However, rw_semaphore->count is 64-bit on Alpha, so
RWSEM_WAITING_BIAS has been defined as -0x0000000100000000L.
Obviously, this blows up in the write contention case.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rwsem.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/rwsem.c b/lib/rwsem.c index 85dcae7e933736..3d8c4401c49c43 100644 --- a/lib/rwsem.c +++ b/lib/rwsem.c @@ -41,8 +41,7 @@ static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int { struct rwsem_waiter *waiter; struct list_head *next; - signed long oldcount; - int woken, loop; + signed long oldcount, woken, loop; rwsemtrace(sem,"Entering __rwsem_do_wake"); |