Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5996
b: refs/heads/master
c: 9c2c38a
h: refs/heads/master
v: v3
  • Loading branch information
Jens Axboe authored and Linus Torvalds committed Aug 24, 2005
1 parent 0e28dfa commit ef8b8b8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 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: 41290c14640bc9312bf63202d14ebef075b6171a
refs/heads/master: 9c2c38a122cc23d6a09b8004d60a33913683eedf
31 changes: 21 additions & 10 deletions trunk/drivers/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static int cfq_slice_idle = HZ / 100;
/*
* disable queueing at the driver/hardware level
*/
static int cfq_max_depth = 1;
static int cfq_max_depth = 2;

/*
* for the hash of cfqq inside the cfqd
Expand Down Expand Up @@ -385,9 +385,15 @@ cfq_choose_req(struct cfq_data *cfqd, struct cfq_rq *crq1, struct cfq_rq *crq2)
return crq2;
if (crq2 == NULL)
return crq1;
if (cfq_crq_requeued(crq1))

if (cfq_crq_requeued(crq1) && !cfq_crq_requeued(crq2))
return crq1;
if (cfq_crq_requeued(crq2))
else if (cfq_crq_requeued(crq2) && !cfq_crq_requeued(crq1))
return crq2;

if (cfq_crq_is_sync(crq1) && !cfq_crq_is_sync(crq2))
return crq1;
else if (cfq_crq_is_sync(crq2) && !cfq_crq_is_sync(crq1))
return crq2;

s1 = crq1->request->sector;
Expand Down Expand Up @@ -1769,18 +1775,23 @@ static void
cfq_crq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
struct cfq_rq *crq)
{
const int sync = cfq_crq_is_sync(crq);
struct cfq_io_context *cic;

cfqq->next_crq = cfq_choose_req(cfqd, cfqq->next_crq, crq);

if (sync) {
struct cfq_io_context *cic = crq->io_context;
/*
* we never wait for an async request and we don't allow preemption
* of an async request. so just return early
*/
if (!cfq_crq_is_sync(crq))
return;

cfq_update_io_thinktime(cfqd, cic);
cfq_update_idle_window(cfqd, cfqq, cic);
cic = crq->io_context;

cic->last_queue = jiffies;
}
cfq_update_io_thinktime(cfqd, cic);
cfq_update_idle_window(cfqd, cfqq, cic);

cic->last_queue = jiffies;

if (cfqq == cfqd->active_queue) {
/*
Expand Down

0 comments on commit ef8b8b8

Please sign in to comment.