Subject: Re: letting userland issue FUA writes
To: Chuck Silvers <chuq@chuq.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 03/15/2006 14:57:53
--lkTb+7nhmha7W+c3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Mar 15, 2006 at 08:31:59AM -0800, Chuck Silvers wrote:
> On Wed, Mar 15, 2006 at 07:28:49AM -0800, Bill Studenmund wrote:
> > > this sounds like direct I/O, which I've talked about before (and which
> > > I am just getting back to looking at recently ).  a new O_DIRECT open=
 flag
> > > on regular files will mean that the read/write should go directly from
> > > disk to the application's address space without going through the
> > > page cache.  if the new behaviour you're talking about it just for
> > > raw disk devices, then we could interpret that flag to mean FUA on
> > > VCHR vnodes.  or are you talking about FUA with regular files?
> >=20
> > As above, I'm most interested in regular files.
>=20
> ok, then I assume that you are only considering this FUA issue in the con=
text
> of direct I/O?  (were you planning on implementing direct I/O as well?)

No, actually I'm not considering this in the context of direct I/O, but=20
I'm not against it either.

> > I'm not sure about O_DIRECT implying FUA. While I can think of apps tha=
t=20
> > want that, I am not sure if if there are or aren't apps that will want=
=20
> > O_DIRECT but not care about FUA.
>=20
> yea, I was hoping to avoid dealing with the ambiguity.  but looking at the
> open() manpage, I see we have the O_{,R,D}SYNC flags to describe the level
> of persistence desired for the I/O, so I think we can use this to allow
> specification of both FUA and non-FUA behaviour:
>=20
> =09
> 	no flags		kernel caching, FUA is irrelevant
> 	O_DIRECT		no kernel caching, no FUA
> 	O_DIRECT|O_*SYNC	no kernel caching, FUA
>=20
> (I think O_*SYNC here would be either O_SYNC or O_DSYNC.)

I don't mind the settings for O_DIRECT, but I know there are times when I=
=20
want FUA even with caching. Mainly I don't care much what the kernel does=
=20
after the write, I just care about the moment of the write. :-)

Take care,

Bill

--lkTb+7nhmha7W+c3
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFEGJvxWz+3JHUci9cRAvAoAJ0bG1QNNhijYCDZ5TaK0Hms7mYQjQCeIdR+
fsh2yVbVnd1kOvNeiydNn0U=
=F0fq
-----END PGP SIGNATURE-----

--lkTb+7nhmha7W+c3--