WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix request-notification holdoff in blkback. New code is
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 04 Dec 2005 00:38:06 +0000
Delivery-date: Sun, 04 Dec 2005 00:38:22 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix request-notification holdoff in blkback. New code is, Xen patchbot -unstable <=