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] Blkif request notifications use generic ring req_event h

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Blkif request notifications use generic ring req_event holdoff
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 02 Dec 2005 14:32:06 +0000
Delivery-date: Fri, 02 Dec 2005 14:32:17 +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 d4ab8e46136ccb64a75dbdb6e84126d6a9552ca4
# Parent  df68a9433492b024963334b124586f56885266fd
Blkif request notifications use generic ring req_event holdoff
mechanism rather than custom mechanism.

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

diff -r df68a9433492 -r d4ab8e46136c 
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c        Fri Dec  2 
12:16:13 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c        Fri Dec  2 
12:27:39 2005
@@ -498,10 +498,14 @@
          * notifications if requests are already in flight (lower overheads
          * and promotes batching).
          */
-       if (!__on_blkdev_list(blkif) &&
-           RING_HAS_UNCONSUMED_REQUESTS(blk_ring)) {
-               add_to_blkdev_list_tail(blkif);
-               maybe_trigger_blkio_schedule();
+       mb();
+       if (!__on_blkdev_list(blkif)) {
+               int more_to_do;
+               RING_FINAL_CHECK_FOR_REQUESTS(blk_ring, more_to_do);
+               if (more_to_do) {
+                       add_to_blkdev_list_tail(blkif);
+                       maybe_trigger_blkio_schedule();
+               }
        }
 
        if (notify)
diff -r df68a9433492 -r d4ab8e46136c 
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Fri Dec  2 
12:16:13 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Fri Dec  2 
12:27:39 2005
@@ -395,16 +395,11 @@
 
 static inline void flush_requests(struct blkfront_info *info)
 {
-       RING_IDX old_prod = info->ring.sring->req_prod;
-
-       RING_PUSH_REQUESTS(&info->ring);
-
-       /*
-         * Send new requests /then/ check if any old requests are still in
-         * flight. If so then there is no need to send a notification.
-         */
-       mb();
-       if (info->ring.sring->rsp_prod == old_prod)
+       int notify;
+
+       RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&info->ring, notify);
+
+       if (notify)
                notify_remote_via_irq(info->irq);
 }
 
diff -r df68a9433492 -r d4ab8e46136c xen/include/public/io/blkif.h
--- a/xen/include/public/io/blkif.h     Fri Dec  2 12:16:13 2005
+++ b/xen/include/public/io/blkif.h     Fri Dec  2 12:27:39 2005
@@ -12,11 +12,10 @@
 #include "ring.h"
 
 /*
- * Front->back notifications: When enqueuing a new request, there is no
- * need to send a notification if there are old requests still in flight
- * (that is, old_req_prod != sring->rsp_prod). The backend guarantees to check
- * for new requests after queuing the response for the last in-flight request.
- * (NB. The generic req_event mechanism is not used for blk requests.)
+ * Front->back notifications: When enqueuing a new request, sending a
+ * notification can be made conditional on req_event (i.e., the generic
+ * hold-off mechanism provided by the ring macros). Backends must set
+ * req_event appropriately (e.g., using RING_FINAL_CHECK_FOR_REQUESTS()).
  * 
  * Back->front notifications: When enqueuing a new response, sending a
  * notification can be made conditional on rsp_event (i.e., the generic

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Blkif request notifications use generic ring req_event holdoff, Xen patchbot -unstable <=