I guess this is bonnie. I'm not sure about its internals, but in the
Connectathon test suite, the following discards cached data and allows
for meaningful over-the-wire reports:
#ifdef MMAP
maddr = mmap((caddr_t)0, (size_t)size, PROT_READ,
MAP_PRIVATE, fd, (off_t)0);
if (maddr == NULL) {
error("can't mmap '%s'", bigfile);
exit(1);
}
if (msync(maddr, (size_t)size, MS_INVALIDATE) < 0) {
error("can't invalidate pages for '%s'", bigfile);
exit(1);
}
if (munmap(maddr, (size_t)size) < 0) {
error("can't munmap '%s'", bigfile);
exit(1);
}
#endif
I was delighted when someone at Sun sent me that code to try out several
years ago and found it worked for us. I'm not certain that Posix
requires this work, someone here once broached the idea of changing it,
but concluded we'd be better off with the status quo.
-Ric Werme
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/