Subject: Re: FIONWRITE proposal
To: Bill Studenmund <wrstuden@netbsd.org>
From: Daniel Carosone <dan@geek.com.au>
List: tech-kern
Date: 10/15/2004 19:33:05
--oxV4ZoPwBLqAyY+a
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Oct 14, 2004 at 06:51:17AM -0700, Bill Studenmund wrote:
> > Essentially, "if I call fsync now, how much disk traffic will I
> > cause?".
>=20
> I don't know of an easy way to get this info.

I'm not sure one exists, but someone can tell us otherwise.. :)

> We'd have to ask the file system. Because in addition to writing
> dirty pages, you may have to write metadata out, which only the file
> system will be able to add up.

True, if it should count metadata. The flippant fsync disk traffic
example was probably a poor one, because I don't think it should
(would you count TCP and IP headers for a socket?).

> > Of course, if it is too hard to find the right answer, one could
> > always havge the ioctl implicitly call fsync first, so the 0 is not
> > any kind of lie. :)
>=20
> But 0 isn't a lie. ;-) All of the bytes written to the file have made it=
=20
> to the file. Perhaps not the disk image of the file, but the kernel image=
=20
> of the file has them. :-) Anywhere in the file that you read, you will se=
e=20
> the bytes you wrote.

I'm not sure that's true in all cases for things like NFS, smbfs, or
some shared-disk cluster filesystem (like solaris' mount -o global),
or probably some other perverse cases (that will be even harder to
come up with the correct figure above :)

--
Dan.


--oxV4ZoPwBLqAyY+a
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iD8DBQFBb5lREAVxvV4N66cRAnYcAKC+RwDpmhjbXCc/qvFLTkkhLsPClACg9rOO
LlxD/JFzeLGQs8c4fsatIyU=
=0wbj
-----END PGP SIGNATURE-----

--oxV4ZoPwBLqAyY+a--