Re: A strange thing with yesterday's head..

From: Giovanni Trematerra <giovanni.trematerra_at_gmail.com>
Date: Thu, 4 Feb 2010 00:43:35 +0100
> Just tried it again (a few times) at r203430, with similar results.

Hi Brandon,
did you update -STABLE? I meant -CURRENT!
Anyway, if you are updating -STABLE, please try the patch below. I
don't know if it applies on -STABLE, let me know.

Thanks for your time.

--
Gianni

--- head/sys/kern/kern_umtx.c	2010/01/10 09:31:57	201991
+++ head/sys/kern/kern_umtx.c	2010/02/03 03:56:32	203414
_at__at_ -2526,6 +2526,12 _at__at_
 		umtxq_busy(&uq->uq_key);
 		umtxq_unlock(&uq->uq_key);

+		/*
+		 * re-read the state, in case it changed between the try-lock above
+		 * and the check below
+		 */
+		state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state));
+
 		/* set read contention bit */
 		while ((state & wrflags) && !(state & URWLOCK_READ_WAITERS)) {
 			oldstate = casuword32(&rwlock->rw_state, state, state |
URWLOCK_READ_WAITERS);
_at__at_ -2658,6 +2664,12 _at__at_
 		umtxq_busy(&uq->uq_key);
 		umtxq_unlock(&uq->uq_key);

+		/*
+		 * re-read the state, in case it changed between the try-lock above
+		 * and the check below
+		 */
+		state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state));
+
 		while (((state & URWLOCK_WRITE_OWNER) || URWLOCK_READER_COUNT(state) != 0) &&
 		       (state & URWLOCK_WRITE_WAITERS) == 0) {
 			oldstate = casuword32(&rwlock->rw_state, state, state |
URWLOCK_WRITE_WAITERS);
Received on Wed Feb 03 2010 - 22:43:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:00 UTC