Skip to content

Commit

Permalink
cfq: fix IOPRIO_CLASS_IDLE delays
Browse files Browse the repository at this point in the history
After the fresh boot:

	ionice -c3 -p $$
	echo cfq >> /sys/block/XXX/queue/scheduler
	dd if=/dev/XXX of=/dev/null bs=512 count=1

Now dd hangs in D state and the queue is completely stalled for approximately
INITIAL_JIFFIES + CFQ_IDLE_GRACE jiffies. This is because cfq_init_queue()
forgets to initialize cfq_data->last_end_request.

(I guess this patch is not complete, overflow is still possible)

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Oleg Nesterov authored and Jens Axboe committed Nov 7, 2007
1 parent 2389d1e commit b70c864
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2126,6 +2126,7 @@ static void *cfq_init_queue(struct request_queue *q)

INIT_WORK(&cfqd->unplug_work, cfq_kick_queue);

cfqd->last_end_request = jiffies;
cfqd->cfq_quantum = cfq_quantum;
cfqd->cfq_fifo_expire[0] = cfq_fifo_expire[0];
cfqd->cfq_fifo_expire[1] = cfq_fifo_expire[1];
Expand Down

0 comments on commit b70c864

Please sign in to comment.