Fix request-notification holdoff in blkback. New code is

more correct and clearer in intent.

Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2005-12-03 21:53:01 +01:00
1 parent c06235d49f
commit 1e56ea4a43
1 file changed
+5 -4
@@ -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);
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.