Re: br_read_lock SMP race fix

From: David S. Miller (davem@redhat.com)
Date: Wed Jul 26 2000 - 07:11:03 EST


   Date: Tue, 25 Jul 2000 04:40:02 +0200 (CEST)
   From: Andrea Arcangeli <andrea@suse.de>

   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.

Your code does nothing more than change a rmb() to a mb(), and you
claim this fixes a bug particularly on Alpha. Then if one goes to
look at include/asm-alpha/system.h:rmb(), they would see that it is
defined identically to mb(). What could you possibly be fixing?

For the record, I believe it is correct on UltraSparc and that cpu has
the most fine grained control of memory ordering desided in the
rmb()/mb()/wmb() interfaces. It allows to specify these operations
precisely. Therefore, Alpha must give the same or more strict
semantics for these interfaces.

Finally, referring to the other part of your change, I believe the
rmb() removal is wrong. The counter decrement memory operations must
not get moved past the memory read in the spinning loop.

Later,
David S. Miller
davem@redhat.com

-
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/



This archive was generated by hypermail 2b29 : Mon Jul 31 2000 - 21:00:21 EST