block/blk-core.c | 1 + block/blk.h | 8 +++++++- block/cfq-iosched.c | 11 ++++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) Index: linux-2.6/block/cfq-iosched.c =================================================================== --- linux-2.6.orig/block/cfq-iosched.c 2011-02-22 13:23:25.000000000 -0500 +++ linux-2.6/block/cfq-iosched.c 2011-02-23 11:54:49.488446104 -0500 @@ -498,7 +498,7 @@ static inline bool cfq_bio_sync(struct b static inline void cfq_schedule_dispatch(struct cfq_data *cfqd) { if (cfqd->busy_queues) { - cfq_log(cfqd, "schedule dispatch"); + cfq_log(cfqd, "schedule dispatch: busy_queues=%d rq_queued=%d rq_in_driver=%d q=%p", cfqd->busy_queues, cfqd->rq_queued, cfqd->rq_in_driver, cfqd->queue); kblockd_schedule_work(cfqd->queue, &cfqd->unplug_work); } } @@ -2229,6 +2229,8 @@ static struct cfq_queue *cfq_select_queu { struct cfq_queue *cfqq, *new_cfqq = NULL; + cfq_log(cfqd, "select_queue: busy_queues=%d rq_queued=%d rq_in_driver=%d", cfqd->busy_queues, cfqd->rq_queued, cfqd->rq_in_driver); + cfqq = cfqd->active_queue; if (!cfqq) goto new_queue; @@ -2499,8 +2501,10 @@ static int cfq_dispatch_requests(struct return cfq_forced_dispatch(cfqd); cfqq = cfq_select_queue(cfqd); - if (!cfqq) + if (!cfqq) { + cfq_log(cfqd, "select: no cfqq selected"); return 0; + } /* * Dispatch a request from this cfqq, if it is allowed @@ -3359,7 +3363,7 @@ static void cfq_insert_request(struct re struct cfq_data *cfqd = q->elevator->elevator_data; struct cfq_queue *cfqq = RQ_CFQQ(rq); - cfq_log_cfqq(cfqd, cfqq, "insert_request"); + cfq_log_cfqq(cfqd, cfqq, "insert_request: busy_queues=%d rq_queued=%d rq_in_driver=%d", cfqd->busy_queues, cfqd->rq_queued, cfqd->rq_in_driver); cfq_init_prio_data(cfqq, RQ_CIC(rq)->ioc); rq_set_fifo_time(rq, jiffies + cfqd->cfq_fifo_expire[rq_is_sync(rq)]); @@ -3707,6 +3711,7 @@ static void cfq_kick_queue(struct work_s struct request_queue *q = cfqd->queue; spin_lock_irq(q->queue_lock); + cfq_log(cfqd, "cfq_kick_queue called. busy_queues=%d rq_queued=%d rq_in_driver=%d", cfqd->busy_queues, cfqd->rq_queued, cfqd->rq_in_driver); __blk_run_queue(cfqd->queue); spin_unlock_irq(q->queue_lock); } Index: linux-2.6/block/blk-core.c =================================================================== --- linux-2.6.orig/block/blk-core.c 2011-02-22 13:23:25.000000000 -0500 +++ linux-2.6/block/blk-core.c 2011-02-23 11:50:34.406700216 -0500 @@ -413,6 +413,7 @@ void __blk_run_queue(struct request_queu queue_flag_clear(QUEUE_FLAG_REENTER, q); } else { queue_flag_set(QUEUE_FLAG_PLUGGED, q); + trace_printk("not recursing. Scheduling another dispatch\n"); kblockd_schedule_work(q, &q->unplug_work); } } Index: linux-2.6/block/blk.h =================================================================== --- linux-2.6.orig/block/blk.h 2011-02-18 13:39:47.000000000 -0500 +++ linux-2.6/block/blk.h 2011-02-23 11:53:37.844304978 -0500 @@ -57,6 +57,8 @@ static inline struct request *__elv_next { struct request *rq; + trace_printk("elv_next_request called. q=%p\n", q); + while (1) { while (!list_empty(&q->queue_head)) { rq = list_entry_rq(q->queue_head.next); @@ -68,8 +70,12 @@ static inline struct request *__elv_next return rq; } - if (!q->elevator->ops->elevator_dispatch_fn(q, 0)) + trace_printk("No requests in q->queue_head. Will call elevator. q=%p\n", q); + + if (!q->elevator->ops->elevator_dispatch_fn(q, 0)) { + trace_printk("No requests in elevator either q=%p\n", q); return NULL; + } } }