diff options
author | Jens Axboe <axboe@suse.de> | 2005-10-28 02:30:39 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2005-10-28 02:48:23 -0400 |
commit | 64521d1a3ba7cc7fe4ab5640da83d88144f05340 (patch) | |
tree | 566f61ed9bbdc1c6ad245cb186fdd8c810a58f25 /drivers/block/elevator.c | |
parent | cb98fc8bb9c141009e2bda99c0db39d387e142cf (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>
Diffstat (limited to 'drivers/block/elevator.c')
-rw-r--r-- | drivers/block/elevator.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c index 272d93946621..cf9bedbb761b 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) | |||
671 | */ | 671 | */ |
672 | spin_lock_irq(q->queue_lock); | 672 | spin_lock_irq(q->queue_lock); |
673 | 673 | ||
674 | set_bit(QUEUE_FLAG_BYPASS, &q->queue_flags); | 674 | set_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags); |
675 | 675 | ||
676 | while (q->elevator->ops->elevator_dispatch_fn(q, 1)) | 676 | while (q->elevator->ops->elevator_dispatch_fn(q, 1)) |
677 | ; | 677 | ; |
678 | 678 | ||
679 | while (q->rq.elvpriv) { | 679 | while (q->rq.elvpriv) { |
680 | spin_unlock_irq(q->queue_lock); | 680 | spin_unlock_irq(q->queue_lock); |
681 | msleep(100); | 681 | msleep(10); |
682 | spin_lock_irq(q->queue_lock); | 682 | spin_lock_irq(q->queue_lock); |
683 | } | 683 | } |
684 | 684 | ||
@@ -703,7 +703,7 @@ static void elevator_switch(request_queue_t *q, struct elevator_type *new_e) | |||
703 | * finally exit old elevator and turn off BYPASS. | 703 | * finally exit old elevator and turn off BYPASS. |
704 | */ | 704 | */ |
705 | elevator_exit(old_elevator); | 705 | elevator_exit(old_elevator); |
706 | clear_bit(QUEUE_FLAG_BYPASS, &q->queue_flags); | 706 | clear_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags); |
707 | return; | 707 | return; |
708 | 708 | ||
709 | fail_register: | 709 | fail_register: |
@@ -716,7 +716,7 @@ fail_register: | |||
716 | fail: | 716 | fail: |
717 | q->elevator = old_elevator; | 717 | q->elevator = old_elevator; |
718 | elv_register_queue(q); | 718 | elv_register_queue(q); |
719 | clear_bit(QUEUE_FLAG_BYPASS, &q->queue_flags); | 719 | clear_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags); |
720 | kfree(e); | 720 | kfree(e); |
721 | error: | 721 | error: |
722 | elevator_put(new_e); | 722 | elevator_put(new_e); |