2003-11-03 00:16:05

by Derek Foreman

[permalink] [raw]
Subject: Re: READAHEAD

On Fri, 31 Oct 2003, Andrew Morton wrote:

> Andrew Morton <[email protected]> wrote:
> >
> > Please, just use time, cat, dd, etc.
> >
> > mount /dev/xxx /mnt/yyy
> > dd if=/dev/zero of=/mnt/yyy/x bs=1M count=1024
> > umount /dev/xxx
> > mount /dev/xxx /mnt/yyy
> > time cat /mnt/yyy/x > /dev/null
>
> And you can do the same against /dev/hdaN if you have a scratch
> partition; that would be interesting.

I don't have a scratch partition, but the effect is quite apparent when
reading from /dev/hd*

I have 384 megs of ram, no swap, and echo 0 > /proc/sys/vm/swappiness
kernel is 2.6.0-test9

hdparm -qa 0 /dev/hde ; dd if=/dev/hde of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes transferred in 103.038178 seconds (10420815 bytes/sec)

hdparm -qa 128 /dev/hde ; dd if=/dev/hde of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes transferred in 34.171719 seconds (31421943 bytes/sec)

hdparm -qa 256 /dev/hde ; dd if=/dev/hde of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes transferred in 34.994348 seconds (30683293 bytes/sec)

hdparm -qa 4096 /dev/hde ; dd if=/dev/hde of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes transferred in 22.268371 seconds (48218247 bytes/sec)

(hdparm -t /dev/hde opens /dev/hde and reads it for a few seconds, so
these numbers are much the same as my hdparm -t scores)

I also get similar results from /dev/md0 in another machine (the only
not-ide device I can test on... but it's still a bunch of ide drives).

note...
For people playing with hdparm, hdparm -a 123 -t /dev/drive doesn't set
the readahead before running the test.