Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26605
b: refs/heads/master
c: dac07ec
h: refs/heads/master
i:
  26603: fa1e6ef
v: v3
  • Loading branch information
Jens Axboe authored and Linus Torvalds committed May 11, 2006
1 parent 4ad085b commit 722b31c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f358166a9405e4f1d8e50d8f415c26d95505b6de
refs/heads/master: dac07ec121de66b6be988b14ae2cd9ce45357b21
8 changes: 7 additions & 1 deletion trunk/block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ void elv_insert(request_queue_t *q, struct request *rq, int where)
{
struct list_head *pos;
unsigned ordseq;
int unplug_it = 1;

blk_add_trace_rq(q, rq, BLK_TA_INSERT);

Expand Down Expand Up @@ -399,6 +400,11 @@ void elv_insert(request_queue_t *q, struct request *rq, int where)
}

list_add_tail(&rq->queuelist, pos);
/*
* most requeues happen because of a busy condition, don't
* force unplug of the queue for that case.
*/
unplug_it = 0;
break;

default:
Expand All @@ -407,7 +413,7 @@ void elv_insert(request_queue_t *q, struct request *rq, int where)
BUG();
}

if (blk_queue_plugged(q)) {
if (unplug_it && blk_queue_plugged(q)) {
int nrq = q->rq.count[READ] + q->rq.count[WRITE]
- q->in_flight;

Expand Down
17 changes: 15 additions & 2 deletions trunk/block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1732,8 +1732,21 @@ void blk_run_queue(struct request_queue *q)

spin_lock_irqsave(q->queue_lock, flags);
blk_remove_plug(q);
if (!elv_queue_empty(q))
q->request_fn(q);

/*
* Only recurse once to avoid overrunning the stack, let the unplug
* handling reinvoke the handler shortly if we already got there.
*/
if (!elv_queue_empty(q)) {
if (!test_and_set_bit(QUEUE_FLAG_REENTER, &q->queue_flags)) {
q->request_fn(q);
clear_bit(QUEUE_FLAG_REENTER, &q->queue_flags);
} else {
blk_plug_device(q);
kblockd_schedule_work(&q->unplug_work);
}
}

spin_unlock_irqrestore(q->queue_lock, flags);
}
EXPORT_SYMBOL(blk_run_queue);
Expand Down

0 comments on commit 722b31c

Please sign in to comment.