lkml.org 
[lkml]   [2000]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectbr_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/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.044 / U:0.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site