Re: [PATCH] O10int for interactivity

From: Diego Calleja García (diegocg@teleline.es)
Date: Tue Jul 29 2003 - 20:16:16 EST


El Wed, 30 Jul 2003 00:35:01 +1000 Con Kolivas <kernel@kolivas.org> escribió:

>
> That's not as silly as it sounds. In fact it should be dead easy to
> increase/decrease the amount of anticipatory time based on the bonus from
> looking at the code. I dunno how the higher filesystem gods feel about this
> though.

I've done a small patch (one line) which tries to implement that.
At as-iosched.c:as_add_request() there's:

        /*
         * set expire time (only used for reads) and add to fifo list
         */
        arq->expires = jiffies + ad->fifo_expire[data_dir];

ad->fifo_expire[data_dir] should be /sys/block/hda/queue/iosched/read_expire
(i've not checked it and i may be wrong) so instead of adding the static read_expire
we increase/decrease it a bit based on current->static_prio
NOTE: I don't even know if static_prio is what i'm searching, just sounds like it is.

diff -puN drivers/block/as-iosched.c~dyndeadline drivers/block/as-iosched.c
--- unsta.moo/drivers/block/as-iosched.c~dyndeadline 2003-07-30 02:49:34.000000000 +0200
+++ unsta.moo-diego/drivers/block/as-iosched.c 2003-07-30 02:51:06.000000000 +0200
@@ -1300,7 +1300,8 @@ static void as_add_request(struct as_dat
        /*
         * set expire time (only used for reads) and add to fifo list
         */
- arq->expires = jiffies + ad->fifo_expire[data_dir];
+ arq->expires = jiffies + ad->fifo_expire[data_dir] +
+ ((ad->fifo_expire[data_dir] * current->static_prio * 5)/100);
        list_add_tail(&arq->fifo, &ad->fifo_list[data_dir]);
        arq->state = AS_RQ_QUEUED;
        as_update_arq(ad, arq); /* keep state machine up to date */

_

The patch should do the following:
read_expire=50 (the default value)

If current->static_prio is -10; the deadline given to the request
is 0; if it's 20 (well, there're only +19 priority i think, but
you get it) the deadline is read_expire*2, and the rest in the
same range.

It isn't a very nice patch; first because deadline 0 is wrong i suppose.
This should be doing read_expire +/- read_expire and probably i'd be
better to set a read_expire +/- 20% read_expire or so. 20 could
be a value exported to sysfs...

Patch effects haven't been tested (I've to awake in 5 hours), but at
least compiles and runs on a 2x box, so it can't be that bad. I hope
it helps.

Diego Calleja
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:43 EST