Skip to content

Commit

Permalink
[PATCH] cfq-iosched: Detect idle process issuing async request
Browse files Browse the repository at this point in the history
If we are anticipating a sync request from this process and we are
waiting for that and see an async request come in, expire that slice
and move on.

Signed-off-by: Jens Axboe <axboe@suse.de>
  • Loading branch information
Jens Axboe committed Jun 1, 2006
1 parent e0de020 commit 12e9fdd
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1747,14 +1747,24 @@ cfq_crq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,

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

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))
if (!cfq_crq_is_sync(crq)) {
/*
* sync process issued an async request, if it's waiting
* then expire it and kick rq handling.
*/
if (cic == cfqd->active_cic &&
del_timer(&cfqd->idle_slice_timer)) {
cfq_slice_expired(cfqd, 0);
cfq_start_queueing(cfqd, cfqq);
}
return;

cic = crq->io_context;
}

cfq_update_io_thinktime(cfqd, cic);
cfq_update_io_seektime(cfqd, cic, crq);
Expand Down

0 comments on commit 12e9fdd

Please sign in to comment.