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

[Xen-devel] [PATCH 06/10] blktap: Drop the ring message timestamp.



Using gettimeofday() seems overkill. The debug node now just dumps
struct request age at jiffy resolution, not time of ring
submission. Looks ok because we never really differentiated from block
request time anyway.

Signed-off-by: Daniel Stodden <daniel.stodden@xxxxxxxxxx>
---
 drivers/block/blktap/blktap.h |    1 -
 drivers/block/blktap/ring.c   |    8 +++-----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/block/blktap/blktap.h b/drivers/block/blktap/blktap.h
index 1318cad..05cfd1f 100644
--- a/drivers/block/blktap/blktap.h
+++ b/drivers/block/blktap/blktap.h
@@ -78,7 +78,6 @@ struct blktap_request {
        int                            usr_idx;
 
        int                            operation;
-       struct timeval                 time;
 
        struct scatterlist             sg_table[BLKTAP_SEGMENT_MAX];
        struct page                   *pages[BLKTAP_SEGMENT_MAX];
diff --git a/drivers/block/blktap/ring.c b/drivers/block/blktap/ring.c
index bae6f82..e667d2d 100644
--- a/drivers/block/blktap/ring.c
+++ b/drivers/block/blktap/ring.c
@@ -304,8 +304,6 @@ blktap_ring_submit_request(struct blktap *tap,
        }
 
        ring->ring.req_prod_pvt++;
-
-       do_gettimeofday(&request->time);
 }
 
 static int
@@ -547,20 +545,20 @@ blktap_ring_debug(struct blktap *tap, char *buf, size_t 
size)
 
        for (usr_idx = 0; usr_idx < BLKTAP_RING_SIZE; usr_idx++) {
                struct blktap_request *request;
-               struct timeval *time;
+               struct timeval t;
 
                request = ring->pending[usr_idx];
                if (!request)
                        continue;
 
-               time  = &request->time;
+               jiffies_to_timeval(jiffies - request->rq->start_time, &t);
 
                s += snprintf(s, end - s,
                              "%02d: usr_idx:%02d "
                              "op:%x nr_pages:%02d time:%lu.%09lu\n",
                              usr_idx, request->usr_idx,
                              request->operation, request->nr_pages,
-                             time->tv_sec, time->tv_usec);
+                             t.tv_sec, t.tv_usec);
        }
 
        s += snprintf(s, end - s, "end pending\n");
-- 
1.7.0.4


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


 


Rackspace

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