Subject: Re: direct I/O again
To: YAMAMOTO Takashi <>
From: Chuck Silvers <>
List: tech-kern
Date: 03/28/2006 08:57:12
On Tue, Mar 28, 2006 at 07:00:33PM +0900, YAMAMOTO Takashi wrote:
> > I've finished the initial implementation of direct I/O,
> > there's an updated diff in:
> > 
> >
> - you need to check values of uvm_km_alloc or specify UVM_KMF_WAITVA.

ok.  it seems odd that the defaults for being willing to sleep are
different depending on whether it's physical memory or virtual space
that is unavailable.  for that matter, it seems odd that anything
would be willing to sleep for one resource and not the other.
perhaps we should just combine the flags into the one UVM_KMF_NOWAIT.
(for now I'll just add the WAITVA flag here.)

> - what prevents the vnode from getting VMAPPED,
>   while you are sleeping somewhere in genfs_do_directio?

oops, that was a mistake.  previously I was setting and clearing VMAPPED
in VOP_MMAP() and VOP_INACTIVE(), and I took the vnode lock in exclusive
mode around the call to VOP_MMAP().  then I noticed the VWRITEMAP flag
and moved the new flag to the same places, but I lost the locking call
in the process.

I put a new diff with these fixed in the same directory.