On Wed, Sep 13, 2000 at 06:57:21PM -0300, Rik van Riel wrote:
> > Another potentially stupid question:
> > When the queue gets too long/old, new requests should be put in
> > a new queue to avoid starvation for the ones in the current
> > queue, right?
>
> Indeed. That would solve the problem...
I think something like this: (I don't know the current code, so maybe
this suggestion is really stupid.....)
struct request_queue {
int4 start_time;
struct request *list;
struct request_queue *next;
}
struct request_queue *current_queue;
function too_old (struct request_queue *q) {
/* can actually easily be implemented using time, nr of requests
or any other messure of amount of work */
if (current_time > q->start_time + MAXTIME)
return 1;
else
return 0;
}
function insert_request(struct request *new) {
struct request_queue *q=current_queue;
if (new->sectornr < current_sector);
q=q->next;
while (too_old(q))
q=q->next;
insert_request(q->list, new);
}
> (maybe with the twist that we /do/ allow merges on the queue
> that's being processed by the disk, but no insertions of new
> requests)
I don't think you should allow merges. If one process is doing a big
IO operation on a big file it would still get _all_ capacity, right?
-- Ragnar Kjørstad - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Fri Sep 15 2000 - 21:00:22 EST