Skip to content

Commit

Permalink
cfq-iosched: reduce write depth only if sync was delayed
Browse files Browse the repository at this point in the history
The introduction of ramp-up formula for async queue depths has
slowed down dirty page reclaim, by reducing async write performance.
This patch makes sure the formula kicks in only when sync request
was recently delayed.

Signed-off-by: Corrado Zoccolo <czoccolo@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Corrado Zoccolo authored and Jens Axboe committed Dec 9, 2009
1 parent 2b876f9 commit 573412b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ struct cfq_data {
*/
struct cfq_queue oom_cfqq;

unsigned long last_end_sync_rq;
unsigned long last_delayed_sync;

/* List of cfq groups being managed on this device*/
struct hlist_head cfqg_list;
Expand Down Expand Up @@ -2264,7 +2264,7 @@ static bool cfq_may_dispatch(struct cfq_data *cfqd, struct cfq_queue *cfqq)
* based on the last sync IO we serviced
*/
if (!cfq_cfqq_sync(cfqq) && cfqd->cfq_latency) {
unsigned long last_sync = jiffies - cfqd->last_end_sync_rq;
unsigned long last_sync = jiffies - cfqd->last_delayed_sync;
unsigned int depth;

depth = last_sync / cfqd->cfq_slice[1];
Expand Down Expand Up @@ -3273,7 +3273,8 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq)

if (sync) {
RQ_CIC(rq)->last_end_request = now;
cfqd->last_end_sync_rq = now;
if (!time_after(rq->start_time + cfqd->cfq_fifo_expire[1], now))
cfqd->last_delayed_sync = now;
}

/*
Expand Down Expand Up @@ -3711,7 +3712,7 @@ static void *cfq_init_queue(struct request_queue *q)
cfqd->cfq_latency = 1;
cfqd->cfq_group_isolation = 0;
cfqd->hw_tag = -1;
cfqd->last_end_sync_rq = jiffies;
cfqd->last_delayed_sync = jiffies - HZ;
INIT_RCU_HEAD(&cfqd->rcu);
return cfqd;
}
Expand Down

0 comments on commit 573412b

Please sign in to comment.