lkml.org 
[lkml]   [1999]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Clearing the I/O caches? (for benchmark tests)
Stephen C. Tweedie wrote:
> Nearly. The ext2 filesystem keeps a cache of recently-accessed bitmap
> buffers pinned in memory, and once that cache is primed you can't flush
> it unless you unmount the filesystem. If you have any processes still
> cd'ed to the active filesystem, then they will also be keeping directory
> inodes pinned in the inode cache.

I use the following script to flush I/O caches for benchmarks.
Does it suffer from the same problem?

thanks,
-- Jamie

#!/bin/sh

# Linux only!
# Flush inode, dentry and buffer cache of all mounted filesystems.
# Must be run as root.
#
# -- Jamie Lokier, March 1999

case "`id -u`" in
0) ;;
*) echo Only root can run this script. 1>&2; exit 1 ;;
esac

mount | sort -k3 -r | \
while read dev ON dir TYPE type etc; do
echo mount $dir -o remount
mount $dir -o remount
done

mount | sort -k1 | \
while read dev ON dir TYPE type etc; do
case "$dev" in
/dev/*) echo hdparm -f $dev
hdparm -f $dev >/dev/null ;;
esac
done

-
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/

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