Messages in this thread Patch in this message | | | Date | Tue, 25 Jul 2000 04:40:02 +0200 (CEST) | From | Andrea Arcangeli <> | Subject | br_read_lock SMP race fix |
| |
This fixes a SMP race condition in the non atomic version of the br_read_lock (at least with the alpha semantics of rmb()) and removes a rmb() not necessary in the slow path. If we want to flush the write queue as soon as possible after the (*ctr)-- then we'd better use wmb() instead of rmb() ;-). I didn't replaced the second rmb() with an wmb() because that's code that never runs and I'd rather prefer to save icache.
--- 2.4.0-test5-pre3/include/linux/brlock.h.~1~ Fri Jul 14 18:47:05 2000 +++ 2.4.0-test5-pre3/include/linux/brlock.h Tue Jul 25 04:08:36 2000 @@ -114,10 +114,9 @@ lock = &__br_write_locks[idx].lock; again: (*ctr)++; - rmb(); + mb(); if (spin_is_locked(lock)) { (*ctr)--; - rmb(); while (spin_is_locked(lock)) barrier(); goto again; Andrea
- 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/
| |