Commit 66958511 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] AS: don't anticipate against a task's initial I/O

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

In the anticipatory scheduler, don't anticipate against the very first IO
request which a process issues.

This solves a very specific problem wherein a process starts, submits a
single IO then exits.
parent b6117830
...@@ -709,6 +709,14 @@ static int as_can_break_anticipation(struct as_data *ad, struct as_rq *arq) ...@@ -709,6 +709,14 @@ static int as_can_break_anticipation(struct as_data *ad, struct as_rq *arq)
return 1; return 1;
} }
if (aic->seek_samples == 0 || aic->ttime_samples == 0) {
/*
* Process has just started IO so default to not anticipate.
* Maybe should be smarter.
*/
return 1;
}
if (aic->ttime_mean > ad->antic_expire) { if (aic->ttime_mean > ad->antic_expire) {
/* the process thinks too much between requests */ /* the process thinks too much between requests */
return 1; 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