Commit c5868eb7 authored by Jens Axboe's avatar Jens Axboe

[PATCH] queue last_merge hint cleanup

Cleanup the last_merge logic. There are two reasons for clearing
last_merge when we are dealing with integrity, and these are:

o Clear when handing the request to the driver, so we don't merge on
  a started request.

o Clear when a request is taken off the list. This cannot be done from
  the driver (above case would already have been hit), but it can
  happen
  when we merge two requests.

This makes it a lot nicer, it was always peculiar how we cleared in
put_request.
parent ad519c69
......@@ -344,6 +344,16 @@ void elv_remove_request(request_queue_t *q, struct request *rq)
{
elevator_t *e = &q->elevator;
/*
* the main clearing point for q->last_merge is on retrieval of
* request by driver (it calls elv_next_request()), but it _can_
* also happen here if a request is added to the queue but later
* deleted without ever being given to driver (merged with another
* request).
*/
if (&rq->queuelist == q->last_merge)
q->last_merge = NULL;
if (e->elevator_remove_req_fn)
e->elevator_remove_req_fn(q, rq);
}
......
......@@ -1509,11 +1509,6 @@ void blk_put_request(struct request *req)
req->q = NULL;
req->rl = NULL;
if (q) {
if (q->last_merge == &req->queuelist)
q->last_merge = NULL;
}
/*
* Request may not have originated from ll_rw_blk. if not,
* it didn't come out of our reserved rq pools
......
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