Subject: Write ordering
To: Brian Buhrow <>
From: Manuel Bouyer <>
List: tech-net
Date: 06/20/2002 21:46:14
[ redirected to tech-net ]

On Thu, Jun 20, 2002 at 10:53:31AM -0700, Brian Buhrow wrote:
> 	Since this discussion has forked into two discussions, I want to ask
> Manuel about his idea for write ordering with disksort() and the sluggish
> behavior one sees with machines which perform heavy i/o to the same disk on
> which paging activities are taking place.

FYI, a simple fix has been commited, which improve things under X.

> 	It strikes me that one simple way to fix this problem, without destroying
> the integrity in which things are written, is to tag each write request
> with an identifier as to who the request came from.  Then, all requests
> from the VM subsystem could be put at the beginning of the queue, while
> normal ordering techniques would be used for all other requests.
> My questions are:
> 1.  Is there a simple mechanism for tagging who a write request came from?

I don't know if the VM system keep track of which process write
which buffer. There may be dirty pages in RAM with no owner: the process who
wrote them has already exit()ed. 

> 2.  Are there complexities here that I just don't understand with regard to
> write ordering?

To have a system which behaves well, I think user process requests have to
be ordered as well. Ideally we should be able to differentiate I/O bound
processes from others, just as we do for CPU bound vs others.

> 3.  What about the note in /usr/src/sys/scsipi/sd.c which says that
> disksort() should only be called if the disk isn't running in tag-queueing
> mode, just before disksort() is unconditionally called anyway?  

Even for tag queuing, disksort() is of some help I believe. The disk
can only hold a few 10s of requests (max 256 for standart SCSI), while you
may have much more requests in the queue.

Manuel Bouyer <>