From: Nick Piggin <piggin@cyberone.com.au>

The addition of the smp_mb and the other change is to try to close the
window for races a bit.  Obviously they can still happen, it's a racy
interface and it doesn't matter much.


---

 25-akpm/drivers/block/ll_rw_blk.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/block/ll_rw_blk.c~blk-congestion-races drivers/block/ll_rw_blk.c
--- 25/drivers/block/ll_rw_blk.c~blk-congestion-races	Wed Mar 10 15:47:07 2004
+++ 25-akpm/drivers/block/ll_rw_blk.c	Wed Mar 10 15:47:07 2004
@@ -110,6 +110,7 @@ static void clear_queue_congested(reques
 
 	bit = (rw == WRITE) ? BDI_write_congested : BDI_read_congested;
 	clear_bit(bit, &q->backing_dev_info.state);
+	smp_mb__after_clear_bit();
 	if (waitqueue_active(wqh))
 		wake_up(wqh);
 }
@@ -1553,7 +1554,6 @@ static void freed_request(request_queue_
 	if (rl->count[rw] < queue_congestion_off_threshold(q))
 		clear_queue_congested(q, rw);
 	if (rl->count[rw]+1 <= q->nr_requests) {
-		smp_mb();
 		if (waitqueue_active(&rl->wait[rw]))
 			wake_up(&rl->wait[rw]);
 		if (!waitqueue_active(&rl->wait[rw]))

_