[BLOCK] Implement elv_drain_elevator for improved switch error detection

This patch adds request_queue->nr_sorted which keeps the number of
requests in the iosched and implement elv_drain_elevator which
performs forced dispatching.  elv_drain_elevator checks whether
iosched actually dispatches all requests it has and prints error
message if it doesn't.  As buggy forced dispatching can result in
wrong barrier operations, I think this extra check is worthwhile.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jens Axboe <axboe@suse.de>
This commit is contained in:
Tejun Heo
2005-11-10 08:52:05 +01:00
committed by Jens Axboe
parent 1b5ed5e1f1
commit 15853af9f0
2 changed files with 22 additions and 5 deletions

View File

@@ -406,6 +406,7 @@ struct request_queue
atomic_t refcnt;
unsigned int nr_sorted;
unsigned int in_flight;
/*
@@ -631,6 +632,7 @@ static inline void elv_dispatch_add_tail(struct request_queue *q,
{
if (q->last_merge == rq)
q->last_merge = NULL;
q->nr_sorted--;
q->end_sector = rq_end_sector(rq);
q->boundary_rq = rq;