Re: clearing filesystem cache for I/O benchmarks

From: Nathan Scott
Date: Wed Jul 28 2004 - 19:17:13 EST


On Mon, Jul 26, 2004 at 11:40:05PM -0700, Andrew Morton wrote:
> ...
> However... If you write any amount of data to a file with O_DIRECT, that
> will, as a side-effect, remove _all_ of that file's pagecache. In 2.4 as
> well as 2.6. So you could scrub the pagecache by reading the first 4k then
> writing it back with O_DIRECT.
>
> However O_DIRECT is supported on very few filesystems in 2.4. ext2 and
> reiserfs have it.
>
> XFS in 2.4 has O_DIRECT, I think, but I don't know if the invalidation
> side-effect works on XFS.

Yep, it does.

cheers.

--
Nathan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/