aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-10-28 08:30:39 +0200
committerJens Axboe <axboe@nelson.home.kernel.dk>2005-10-28 08:48:23 +0200
commit64521d1a3ba7cc7fe4ab5640da83d88144f05340 (patch)
tree566f61ed9bbdc1c6ad245cb186fdd8c810a58f25
parentcb98fc8bb9c141009e2bda99c0db39d387e142cf (diff)
[BLOCK] elevator switch fixes/cleanup
- 100msec sleep is a little excessive, lots of requests can complete in that timeframe. Use 10msec instead. - Rename QUEUE_FLAG_BYPASS to QUEUE_FLAG_ELVSWITCH to indicate what is going on. Signed-off-by: Jens Axboe <axboe@suse.de>
-rw-r--r--drivers/block/elevator.c8
-rw-r--r--drivers/block/ll_rw_blk.c2
-rw-r--r--include/linux/blkdev.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c
index 272d9394662..cf9bedbb761 100644
--- a/drivers/block/elevator.c
+++ b/drivers/block/elevator.c
@@ -671,14 +671,14 @@ static void elevator_switch(request_queue_t *q, struct elevator_type *new_e)
*/
spin_lock_irq(q->queue_lock);
- set_bit(QUEUE_FLAG_BYPASS, &q->queue_flags);
+ set_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags);
while (q->elevator->ops->elevator_dispatch_fn(q, 1))
;
while (q->rq.elvpriv) {
spin_unlock_irq(q->queue_lock);
- msleep(100);
+ msleep(10);
spin_lock_irq(q->queue_lock);
}
@@ -703,7 +703,7 @@ static void elevator_switch(request_queue_t *q, struct elevator_type *new_e)
* finally exit old elevator and turn off BYPASS.
*/
elevator_exit(old_elevator);
- clear_bit(QUEUE_FLAG_BYPASS, &q->queue_flags);
+ clear_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags);
return;
fail_register:
@@ -716,7 +716,7 @@ fail_register:
fail:
q->elevator = old_elevator;
elv_register_queue(q);
- clear_bit(QUEUE_FLAG_BYPASS, &q->queue_flags);
+ clear_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags);
kfree(e);
error:
elevator_put(new_e);
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
index f7c9931cb38..fc12d019b19 100644
--- a/drivers/block/ll_rw_blk.c
+++ b/drivers/block/ll_rw_blk.c
@@ -1940,7 +1940,7 @@ get_rq:
if (rl->count[rw] >= queue_congestion_on_threshold(q))
set_queue_congested(q, rw);
- priv = !test_bit(QUEUE_FLAG_BYPASS, &q->queue_flags);
+ priv = !test_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags);
if (priv)
rl->elvpriv++;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 6186d5e2110..7d9d14d6d8f 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -442,7 +442,7 @@ enum {
#define QUEUE_FLAG_DEAD 5 /* queue being torn down */
#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */
#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */
-#define QUEUE_FLAG_BYPASS 8 /* don't use elevator, just do FIFO */
+#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */
#define QUEUE_FLAG_FLUSH 9 /* doing barrier flush sequence */
#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)