Commit 52e36bc2 authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] get_request() starvation fix

This is originally from Andrew in the 2.4 series, please apply for 2.5
as well.
parent b73335fe
......@@ -899,10 +899,10 @@ static struct request *get_request_wait(request_queue_t *q, int rw)
spin_lock_prefetch(q->queue_lock);
generic_unplug_device(q);
add_wait_queue(&rl->wait, &wait);
add_wait_queue_exclusive(&rl->wait, &wait);
do {
set_current_state(TASK_UNINTERRUPTIBLE);
if (rl->count < batch_requests)
if (!rl->count)
schedule();
spin_lock_irq(q->queue_lock);
rq = get_request(q, rw);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment