aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-04-12 04:12:19 -0400
committerJens Axboe <jaxboe@fusionio.com>2011-04-12 04:12:19 -0400
commit94b5eb28b41cc79d9713696e0005ae167b5afd1b (patch)
tree404680c86a360bfe623b5a287ee87dd5263b5a8e /block
parentd9c97833179036408e53ef5f3f5c7eaf781769bc (diff)
block: fixup block IO unplug trace call
It was removed with the on-stack plugging, readd it and track the depth of requests added when flushing the plug. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index eeaca0998df5..d20ce1e849c8 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2668,12 +2668,19 @@ static int plug_rq_cmp(void *priv, struct list_head *a, struct list_head *b)
2668 return !(rqa->q <= rqb->q); 2668 return !(rqa->q <= rqb->q);
2669} 2669}
2670 2670
2671static void queue_unplugged(struct request_queue *q, unsigned int depth)
2672{
2673 trace_block_unplug_io(q, depth);
2674 __blk_run_queue(q, false);
2675}
2676
2671static void flush_plug_list(struct blk_plug *plug) 2677static void flush_plug_list(struct blk_plug *plug)
2672{ 2678{
2673 struct request_queue *q; 2679 struct request_queue *q;
2674 unsigned long flags; 2680 unsigned long flags;
2675 struct request *rq; 2681 struct request *rq;
2676 LIST_HEAD(list); 2682 LIST_HEAD(list);
2683 unsigned int depth;
2677 2684
2678 BUG_ON(plug->magic != PLUG_MAGIC); 2685 BUG_ON(plug->magic != PLUG_MAGIC);
2679 2686
@@ -2688,6 +2695,7 @@ static void flush_plug_list(struct blk_plug *plug)
2688 } 2695 }
2689 2696
2690 q = NULL; 2697 q = NULL;
2698 depth = 0;
2691 local_irq_save(flags); 2699 local_irq_save(flags);
2692 while (!list_empty(&list)) { 2700 while (!list_empty(&list)) {
2693 rq = list_entry_rq(list.next); 2701 rq = list_entry_rq(list.next);
@@ -2696,10 +2704,11 @@ static void flush_plug_list(struct blk_plug *plug)
2696 BUG_ON(!rq->q); 2704 BUG_ON(!rq->q);
2697 if (rq->q != q) { 2705 if (rq->q != q) {
2698 if (q) { 2706 if (q) {
2699 __blk_run_queue(q, false); 2707 queue_unplugged(q, depth);
2700 spin_unlock(q->queue_lock); 2708 spin_unlock(q->queue_lock);
2701 } 2709 }
2702 q = rq->q; 2710 q = rq->q;
2711 depth = 0;
2703 spin_lock(q->queue_lock); 2712 spin_lock(q->queue_lock);
2704 } 2713 }
2705 rq->cmd_flags &= ~REQ_ON_PLUG; 2714 rq->cmd_flags &= ~REQ_ON_PLUG;
@@ -2711,10 +2720,12 @@ static void flush_plug_list(struct blk_plug *plug)
2711 __elv_add_request(q, rq, ELEVATOR_INSERT_FLUSH); 2720 __elv_add_request(q, rq, ELEVATOR_INSERT_FLUSH);
2712 else 2721 else
2713 __elv_add_request(q, rq, ELEVATOR_INSERT_SORT_MERGE); 2722 __elv_add_request(q, rq, ELEVATOR_INSERT_SORT_MERGE);
2723
2724 depth++;
2714 } 2725 }
2715 2726
2716 if (q) { 2727 if (q) {
2717 __blk_run_queue(q, false); 2728 queue_unplugged(q, depth);
2718 spin_unlock(q->queue_lock); 2729 spin_unlock(q->queue_lock);
2719 } 2730 }
2720 2731