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

[Xen-changelog] Blkif request notifications use generic ring req_event holdoff



# 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


 


Rackspace

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