Subject: Re: I/O priorities
To: Wojciech Puchar <wojtek@chylonia.3miasto.net>
From: Aidan Cully <aidan@kublai.com>
List: tech-kern
Date: 06/20/2002 09:15:41
On Thu, Jun 20, 2002 at 03:01:46PM +0200, Wojciech Puchar wrote:
> > Maybe an I/O scheduler makes sense as a solution to this problem?  Or
> > would that be Too Much Effort?  If so, another solution might be to
> > restrict the percentage of available buffers a given process can use
> > for read/write...  Keep it small enough, and you wouldn't need to wait
> > seconds for dd if=/dev/zero to flush all of its buffers.
> 
> seconds sound cool. but does it mean per-process queues???

I don't think so.  Write ordering should be preserved, but if a process
tries to schedule a write when no buffers are available to it (but
would be available to other processes) then it would block.  A process
would need keep track of how many buffers it's using for I/O so that
it would know to block when it's using too many.  A buffer would need to
know which process it's coming from, so that it could lower the process
buffer count on free(), and wake the process up if necessary.

> and what if 2 processes writes to same file/place in file?
> 
> there is never a case that 2 processes executes on 1 CPU in same time, but
> it is possible that 2 processes will schedule similar writes

Isn't that currently the case?

--aidan