Commit 92327d28 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] AS: thinktime improvement

From: Nick Piggin <piggin@cyberone.com.au>

Sometimes a processes thinktime shouldn't be measured on how soon it
submits its next request, but how soon any close request is submitted.

Some processes, such as those in make -j, find | xargs blah, etc. Should be
waited upon even if they never submit another request, because they work with
cooperating or child processes. This helps to take that into account.
parent 7950701f
......@@ -657,6 +657,7 @@ static int as_close_req(struct as_data *ad, struct as_rq *arq)
return (last - (delta>>1) <= next) && (next <= last + delta);
}
static void as_update_thinktime(struct as_data *ad, struct as_io_context *aic, unsigned long ttime);
/*
* as_can_break_anticipation returns true if we have been anticipating this
* request.
......@@ -686,6 +687,15 @@ static int as_can_break_anticipation(struct as_data *ad, struct as_rq *arq)
if (arq && arq->is_sync == REQ_SYNC && as_close_req(ad, arq)) {
/* close request */
struct as_io_context *aic = ioc->aic;
if (aic) {
unsigned long thinktime;
spin_lock(&aic->lock);
thinktime = jiffies - aic->last_end_request;
aic->last_end_request = jiffies;
as_update_thinktime(ad, aic, thinktime);
spin_unlock(&aic->lock);
}
return 1;
}
......
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