[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Fix request-notification holdoff in blkback. New code is



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID bbef89ec44b86b87cd0f108bf5d15a6e2b6562e7
# Parent  d24ab5abf85706a71e9e9ac80376ff1fce49a50b
Fix request-notification holdoff in blkback. New code is
more correct and clearer in intent.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r d24ab5abf857 -r bbef89ec44b8 
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c        Sat Dec  3 
20:17:11 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c        Sat Dec  3 
20:53:01 2005
@@ -483,23 +483,22 @@
        blkif_back_ring_t *blk_ring = &blkif->blk_ring;
        int notify;
 
+       spin_lock_irqsave(&blkif->blk_ring_lock, flags);
+
        /* Place on the response ring for the relevant domain. */ 
-       spin_lock_irqsave(&blkif->blk_ring_lock, flags);
        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) {
@@ -507,6 +506,8 @@
                        maybe_trigger_blkio_schedule();
                }
        }
+
+       spin_unlock_irqrestore(&blkif->blk_ring_lock, flags);
 
        if (notify)
                notify_remote_via_irq(blkif->irq);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.