*Sigh*. This time the problem is in up(). We should not increment
waking if count > 0 in wake_one_more().
Ivan.
--- linux/include/asm-alpha/semaphore-helper.h.orig Thu Apr 15 16:42:32 1999
+++ linux/include/asm-alpha/semaphore-helper.h Fri May 7 19:59:46 1999
@@ -18,7 +18,23 @@
static inline void
wake_one_more(struct semaphore * sem)
{
- atomic_inc(&sem->waking);
+ long tmp, tmp1;
+
+ /* if (count <= 0) waking++ */
+ /* An atomic conditional increment. */
+ __asm__ __volatile__(
+ "1: ldq_l %0,%2\n"
+ " addq %0,%3,%1\n"
+ " addl %0,0,%0\n"
+ " bgt %0,2f\n"
+ " stq_c %1,%2\n"
+ " beq %1,3f\n"
+ "2:\n"
+ ".section .text2,\"ax\"\n"
+ "3: br 1b\n"
+ ".previous"
+ : "=&r"(tmp), "=&r"(tmp1), "=m"(*sem)
+ : "r"(0x0000000100000000));
}
static inline int
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/