diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-12-03 21:53:01 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-12-03 21:53:01 +0100 |
commit | 1e56ea4a43c013b779b7a7f0d8e214c8e2801d07 (patch) | |
tree | 430e5575cebf5de61a446e3599c8e9dae3b506a8 | |
parent | c06235d49f52b12ccc696ff19722e414a2d98965 (diff) | |
download | xen-1e56ea4a43c013b779b7a7f0d8e214c8e2801d07.tar.gz xen-1e56ea4a43c013b779b7a7f0d8e214c8e2801d07.tar.bz2 xen-1e56ea4a43c013b779b7a7f0d8e214c8e2801d07.zip |
Fix request-notification holdoff in blkback. New code is
more correct and clearer in intent.
Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r-- | linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c index f689dd0662..fcc6c12de4 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c @@ -483,23 +483,22 @@ static void make_response(blkif_t *blkif, unsigned long id, blkif_back_ring_t *blk_ring = &blkif->blk_ring; int notify; - /* Place on the response ring for the relevant domain. */ spin_lock_irqsave(&blkif->blk_ring_lock, flags); + + /* Place on the response ring for the relevant domain. */ resp = RING_GET_RESPONSE(blk_ring, blk_ring->rsp_prod_pvt); resp->id = id; resp->operation = op; resp->status = st; blk_ring->rsp_prod_pvt++; RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(blk_ring, notify); - spin_unlock_irqrestore(&blkif->blk_ring_lock, flags); /* * Tail check for pending requests. Allows frontend to avoid * notifications if requests are already in flight (lower overheads * and promotes batching). */ - mb(); - if (!__on_blkdev_list(blkif)) { + if (blk_ring->rsp_prod_pvt == blk_ring->req_cons) { int more_to_do; RING_FINAL_CHECK_FOR_REQUESTS(blk_ring, more_to_do); if (more_to_do) { @@ -508,6 +507,8 @@ static void make_response(blkif_t *blkif, unsigned long id, } } + spin_unlock_irqrestore(&blkif->blk_ring_lock, flags); + if (notify) notify_remote_via_irq(blkif->irq); } |