Re: disk benchmarks & linux

David S. Miller (davem@jenolan.rutgers.edu)
Sun, 14 Sep 1997 01:42:27 -0400


Date: Sat, 13 Sep 1997 22:31:21 -0700
From: Larry McVoy <lm@linux.cobaltmicro.com>

So I'm polishing up yet another whizzy benchmark and I'm getting
screwed, somewhat, by the fact that Linux doesn't have raw devices
so the buffer cache can throw me off when I'm doing I/O on /dev/sda
or something similar.

Is there any way to force the data out of the cache other than to
try and use up all of memory?

void flush_buffer_cache(int device_fd)
{
int err;

err = ioctl(device_fd, BLKFLSBUF, 0);
if(err < 0)
perror("flush_buffer_cache");
}

Later,
David "Sparc" Miller
davem@caip.rutgers.edu