lkml.org 
[lkml]   [2004]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: clearing filesystem cache for I/O benchmarks
Date
Tim Wright <timw@splhi.com> writes:

> Take a look at the code in hdparm tool that handles the '-f' option.
>
> Basically calling ioctl(fd, BLKFLSBUF, o) where fd is a file descriptor
> opened on the block device on which your filesystem resides should be
> enough to clear the cache.

Thanks, that looks pretty useful, at least to force the I/O to make it
outside the kernel. I'm still getting cache hits for some read tests
though, no doubt due to cache near the physical disks and/or
controllers. Correct me if I'm wrong, but this ioctl doesn't appear
to go out and tell disks to clear their caches.

I think I'll use the BLKFLSBUF in any case in my tests though, as it
doesn't seem to take very long to execute. It can't hurt, and should
complement the act of reading through a large dummy file, which should
take care of the disk/controller caches.
--
Benjamin Rutt

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

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.138 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site