From 669585113bfaef4476993b56893b27705ecc9aaf Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 31 Aug 2003 04:33:27 -0700 Subject: [PATCH] [PATCH] AS: don't anticipate against a task's initial I/O From: Nick Piggin 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. --- drivers/block/as-iosched.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/block/as-iosched.c b/drivers/block/as-iosched.c index a12daf1fd7bf0..e520c51d78cfe 100644 --- a/drivers/block/as-iosched.c +++ b/drivers/block/as-iosched.c @@ -709,6 +709,14 @@ static int as_can_break_anticipation(struct as_data *ad, struct as_rq *arq) 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) { /* the process thinks too much between requests */ return 1; -- 2.53.0