Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172945
b: refs/heads/master
c: cf7c25c
h: refs/heads/master
i:
  172943: 5a71248
v: v3
  • Loading branch information
Corrado Zoccolo authored and Jens Axboe committed Nov 8, 2009
1 parent 241c970 commit afadc07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 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: 622d32d3ec40d5075523656ef0ea836f6a595ae3
refs/heads/master: cf7c25cf91f632a3528669fc0876e1fc8355ff9b
13 changes: 7 additions & 6 deletions trunk/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,9 @@ static inline bool cfq_slice_used(struct cfq_queue *cfqq)
* behind the head is penalized and only allowed to a certain extent.
*/
static struct request *
cfq_choose_req(struct cfq_data *cfqd, struct request *rq1, struct request *rq2)
cfq_choose_req(struct cfq_data *cfqd, struct request *rq1, struct request *rq2, sector_t last)
{
sector_t last, s1, s2, d1 = 0, d2 = 0;
sector_t s1, s2, d1 = 0, d2 = 0;
unsigned long back_max;
#define CFQ_RQ1_WRAP 0x01 /* request 1 wraps */
#define CFQ_RQ2_WRAP 0x02 /* request 2 wraps */
Expand All @@ -479,8 +479,6 @@ cfq_choose_req(struct cfq_data *cfqd, struct request *rq1, struct request *rq2)
s1 = blk_rq_pos(rq1);
s2 = blk_rq_pos(rq2);

last = cfqd->last_position;

/*
* by definition, 1KiB is 2 sectors
*/
Expand Down Expand Up @@ -595,7 +593,7 @@ cfq_find_next_rq(struct cfq_data *cfqd, struct cfq_queue *cfqq,
next = rb_entry_rq(rbnext);
}

return cfq_choose_req(cfqd, next, prev);
return cfq_choose_req(cfqd, next, prev, blk_rq_pos(last));
}

static unsigned long cfq_slice_offset(struct cfq_data *cfqd,
Expand Down Expand Up @@ -843,7 +841,7 @@ static void cfq_add_rq_rb(struct request *rq)
* check if this request is a better next-serve candidate
*/
prev = cfqq->next_rq;
cfqq->next_rq = cfq_choose_req(cfqd, cfqq->next_rq, rq);
cfqq->next_rq = cfq_choose_req(cfqd, cfqq->next_rq, rq, cfqd->last_position);

/*
* adjust priority tree position, if ->next_rq changes
Expand Down Expand Up @@ -950,6 +948,7 @@ static void
cfq_merged_requests(struct request_queue *q, struct request *rq,
struct request *next)
{
struct cfq_queue *cfqq = RQ_CFQQ(rq);
/*
* reposition in fifo if next is older than rq
*/
Expand All @@ -959,6 +958,8 @@ cfq_merged_requests(struct request_queue *q, struct request *rq,
rq_set_fifo_time(rq, rq_fifo_time(next));
}

if (cfqq->next_rq == next)
cfqq->next_rq = rq;
cfq_remove_request(next);
}

Expand Down

0 comments on commit afadc07

Please sign in to comment.