From: Tim Wright <timw@splhi.com>
To: Benjamin Rutt <rutt.4+news@osu.edu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: clearing filesystem cache for I/O benchmarks
Date: Fri, 23 Jul 2004 22:31:30 -0700 [thread overview]
Message-ID: <1090647090.8775.19.camel@kryten.internal.splhi.com> (raw)
In-Reply-To: <87vfgeuyf5.fsf@osu.edu>
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.
Regards,
Tim
On Fri, 2004-07-23 at 15:54, Benjamin Rutt wrote:
> How can I purge all of the kernel's filesystem caches, so I can trust
> that my I/O (read) requests I'm trying to benchmark bypass the kernel
> filesystem cache?
>
> Unfortunately, I cannot:
>
> 1) reboot the system
>
> 2) re-mount the filesystem where the reads are occuring
>
> So I propose that I am left with the following options:
>
> 3) Reading through a file sufficiently larger than the RAM installed
> on the system? e.g. read through a 10GB file on a machine with 8GB
> of RAM
>
> 4) Since I can create the files fresh every time, I would write() them
> out using O_DIRECT flag to open(), then the immediately following
> read of that file would be guaranteed to avoid pulling it from
> cache.
>
> So, can someone evaluate whether how whether options 3 and 4 would
> work, or offer other suggestons? And I wouldn't object if the issue
> of clearing disk and controller cache entered into the discussion (I'm
> thinking #3 would do a better job at clearing disk/controller caches).
>
> In case it is relevant, here are the two relevant kernel versions I'm
> using, both under the distribution "Red Hat Enterprise Linux AS
> release 3 (Taroon)":
>
> Linux xio11 2.6.6 #2 SMP Wed Jun 9 10:37:24 EDT 2004 i686 i686 i386 GNU/Linux
>
> Linux xio06 2.4.21-9.ELhugemem #1 SMP Tue Apr 27 13:52:32 EDT 2004 i686 i686 i386 GNU/Linux
>
> Thank you,
--
Tim Wright <timw@splhi.com>
Splhi
next prev parent reply other threads:[~2004-07-24 5:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-23 22:54 Benjamin Rutt
2004-07-24 5:21 ` Chris Wedgwood
2004-07-24 5:31 ` Tim Wright [this message]
2004-07-26 0:07 ` Benjamin Rutt
2004-07-26 1:40 ` Bernd Eckenfels
2004-07-26 12:47 ` Benjamin Rutt
2004-07-25 8:11 ` Andreas Haumer
2004-07-26 7:25 ` Andrew Morton
2004-07-26 13:02 ` Benjamin Rutt
2004-07-27 6:40 ` Andrew Morton
2004-07-27 7:16 ` Hans Reiser
2004-07-27 17:31 ` Benjamin Rutt
2004-07-27 18:03 ` Hans Reiser
2004-07-28 12:38 ` Benjamin Rutt
2004-07-28 17:03 ` Hans Reiser
2004-07-28 18:19 ` Benjamin Rutt
2004-07-27 17:25 ` Benjamin Rutt
2004-07-27 20:00 ` Timothy Miller
2004-07-28 12:51 ` Benjamin Rutt
2004-07-29 1:05 ` Nathan Scott
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1090647090.8775.19.camel@kryten.internal.splhi.com \
--to=timw@splhi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rutt.4+news@osu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®