Subject: Re: ATI IXP IDE chipset support
To: Karl Janmar <karl@utopiafoundation.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 10/14/2004 19:47:15
--EeQfGwPcQSOJBaQU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Wed, Oct 13, 2004 at 07:19:54PM +0200, Karl Janmar wrote:
> 
> The machine is a P4 Celeron 2.4Ghz,
> 2 disks,
> one SATA 120Gig Maxtor 8MB cache,
> one ATA 120Gig Seagate 8MB cache.
> 
> Something is not right as I get a performace increase of about 30times
> with the ATA disk, as compare to the 10times on the SATA disk.

Maybe SATA does a better job when no specific drivers are present.
How much do you get out of each disk ?

You can also try the attached program:
./tst /dev/rwd0d 30000
(increase the second parameter if it completes in less than 2 seconds)
This will benchmark the bandwith available between the drive's cache and
the host (as opposed to the overall drive performances).

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

--EeQfGwPcQSOJBaQU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="tst.c"

#include <fcntl.h>
#include <unistd.h>
#include <sys/time.h>

main(int argc, char **argv)
{
	static char buf[64*1024];
	int fd, i;
	struct timeval tv0, tv1;
	int t;

	fd = open(argv[1], O_RDONLY, 0);
	if (fd < 0) {
		perror("open");
		exit(1);
	}
	if (gettimeofday(&tv0, NULL) < 0) {
		perror("gettimeofday");
		exit(1);
	}
	for (i = 0; i < atoi(argv[2]); i++) {
		if (read(fd, buf, sizeof(buf)) != sizeof(buf)) {
			perror("read");
			exit(1);
		}
		if (lseek(fd, 0, SEEK_SET) < 0) {
			perror("seek");
			exit(1);
		}
			
	}
	if (gettimeofday(&tv1, NULL) < 0) {
		perror("gettimeofday");
		exit(1);
	}
	t = (tv1.tv_sec - tv0.tv_sec) * 1000000;
	t = t + tv1.tv_usec - tv0.tv_usec;
	printf("%d us, %f MB/s\n", t,
	    ((double)64 * (double)i / 1024) / ((double)t / 1000000));
	exit(0);
}

--EeQfGwPcQSOJBaQU--