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:15:49
On Thu, Jun 20, 2002 at 09:28:50PM +0200, Manuel Bouyer wrote:
> On Thu, Jun 20, 2002 at 12:09:44PM -0700, Greywolf wrote:
> > On Thu, 20 Jun 2002, Wojciech Puchar wrote:
> > # Manuel Bouyer a ecrive:
> > #
> > # > > others can have 10 partitions, one can mostly do I/O on one partition,
> > # > > another spread it evenly. what i don't understand?
> > # >
> > # > Because you may want to say, e.g. that the swap, / and /usr partition are
> > # > highter priorities.
> > # > The usual way to solve this is to add more disks, but it's not always possible.
> > #
> > #
> > # sounds different as an option. thanks for explanation
> > 
> > Why not prioritise by type of partition rather than by partition proper
> > (i.e. say swap gets slightly lower priority than ffs)?  Is there need to
> > prioritise by physical partition?
> 
> Why limit to type of partitions, when you could have a finer-grain tuning ?
> I'd like to be able to say, on my mail server, / and /usr should be
> serviced before /var/mail, for example.

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
kernel-based mechanisms for adding an I/O op to different level queues.

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.

Need I mention what a boon this would be for a journaled filesystem? :)
Journal writes to queue x, other writes to queue x+1.

Of course, there has to be policy and security aspects here.  We don't 
want everyone going for queue zero - it would defeat the purpose.  Queue
zero would be for emergency kernel ops.  How to enforce it, other than 
by code review?

If you want a particular mount to have a higher priority, a mount flag 
would instruct the filesystem to bump its queue selection by one.

Just some random thoughts.

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