Subject: Re: Extension of fsync_range() to permit forcing disk cache flushing
To: Alan Barrett <>
From: Bill Studenmund <>
List: tech-kern
Date: 12/17/2004 11:23:18
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Dec 17, 2004 at 12:09:30PM +0200, Alan Barrett wrote:
> On Thu, 16 Dec 2004, Bill Studenmund wrote:
> > If instead we force fsync() and fsync_range() to always clear the cache,
> > we prevent admins from being able to decide what is safe-enough.
> BTW, I don't want fsync() and fsync() range to flush the entire cache; I
> just want them to flush the part of the cache that contains the data I
> care about.  Yes, I know that caches usually don't have a way of doing
> that, but if they did, then it would be good enough.

I thought about that. The problem is that we would have to add a lot of=20
complexity to the file systems to figure out exactly what parts of the=20
file and file system are covered in what ranges. SCSI has SYNCHRONIZE=20
CACHE which takes a start and range, but we have to figure out what ranges=
we want to sync. I was not excited at the prospect of adding code to=20
figure all of this out. :-)

I think such a range sync would only be a win if the file in question is=20
smaller than the disk cache.

Take care,


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.3 (NetBSD)