Subject: Re: I/O priorities
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: John Franklin <franklin@elfie.org>
List: tech-kern
Date: 06/20/2002 17:58:50
On Thu, Jun 20, 2002 at 11:24:33PM +0200, Manuel Bouyer wrote:
> On Thu, Jun 20, 2002 at 05:15:49PM -0400, John Franklin wrote:
> > Why do we want to tie priorities to anything other than an abstraction of
> > priorities?  That is, why not make an n-queue system in which queue 0 has
> > the highest priority and must be cleared before anything on queue 1 can
> > be serviced, then queue 2, dot dot dot, then queue n.  Then provide
> 
> No, there needs to be some limit for each queue, otherwise we can end up
> with requests in lower priority queue never been serviced. I was thinking
> at something more like proportional priorities (queue 1 gets serviced 1
> time when queue 0 gets 2 times, or something like that).

Yes, I can see this to prevent starvation.  Would an on-demand queue be
needed for real-time operations?  Actually, it could be added in later
when harder real-time support is added to the kernel.

> > That way swap, when it is in trouble, can put a bunch of writes on queue 
> > zero, but mundane housekeeping swap (like a process ending) is put on a
> > lower-priority queue.
> 
> There's noting preventing this in my proposal. The priority put on parititons
> could just be a hint among others for the kernel when choosing the queue.

While hints keep the kernel in control (a Good Thing), would the hints
also guarantee write A has a higher priority than B and therefore A would 
be written out first?  I'm thinking about softdeps here, in particular.

> > If you want a particular mount to have a higher priority, a mount flag 
> > would instruct the file system to bump its queue selection by one.
> 
> Not a mount flag, because not all partitions are mounted. I was thinking
> about disklabel as the place for this information.

Fair enough.  That would allow adjusted priority to databases or news
servers that directly manage a partition.  I'd like to see it as a mount
flag as well, though, so you can test a priority without having to rewrite 
the disklabel, and change a mounted file system with a mount -u.

jf
-- 
John Franklin
franklin@elfie.org
ICBM: 35°43'56"N 78°53'27"W