From owner-freebsd-hackers Sat Oct 7 14:20:48 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id OAA24587 for hackers-outgoing; Sat, 7 Oct 1995 14:20:48 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id OAA24581 for ; Sat, 7 Oct 1995 14:20:37 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id HAA03150; Sun, 8 Oct 1995 07:15:43 +1000 Date: Sun, 8 Oct 1995 07:15:43 +1000 From: Bruce Evans Message-Id: <199510072115.HAA03150@godzilla.zeta.org.au> To: dennis@etinc.com, hackers@freebsd.org Subject: Re: VLB Disk Controllers Sender: owner-hackers@freebsd.org Precedence: bulk >Justin Gibbs says, >>>Adaptec, Buslogic. Any possitive or negative comments on the drivers would >>>be welcome. >>> >>>Dennis >> >>The 2842 seems to work well, supports tagged queuing and other advanced >>SCSI II features that the buslogic (may be a driver limitation) does not. >>The adaptec has much lower command overhead than the buslogic That's not saying much. An IDE controller has a much lower command overhead than the buslogic: Buslogic BT44C on 486DX2/66 VLB TOSHIBA MK537FB (slow disk): Output for disklatency /dev/rsd0: Command overhead is 4741 usec (time_4096 = 5164, time_8192 = 5586) transfer speed is 9.6955e+06 bytes/sec Buslogic BT44C on 486DX2/66 VLB (QUANTUM XP34301 (fast disk): output for disklatency /dev/rsd1: Command overhead is 3968 usec (time_4096 = 4295, time_8192 = 4622) transfer speed is 1.25286e+07 bytes/sec Cheap IDE on 486DX/33 ISA SAMSUNG SHD-3212A (slow disk): output for disklatency /dev/rwd0: Command overhead is 573 usec (time_4096 = 2830, time_8192 = 5087) transfer speed is 1.81489e+06 bytes/sec A high command overhead causes slow file system operations for everything except large i/o's. What are the command overheads of other popular controllers? Bruce --- disklatency.c --- #include #include #include #include #include #define ITERATIONS 1000 static int syserror(const char *where); static long timeit(int fd, char *buf, unsigned blocksize); int main(int argc, char **argv) { char buf[2 * 4096]; int fd; long time_4096; long time_8192; if (argc != 2) { fprintf(stderr, "usage: %s device\n", argv[0]); exit(1); } fd = open(argv[1], O_RDONLY); if (fd == -1) syserror("open"); time_4096 = timeit(fd, buf, 4096); time_8192 = timeit(fd, buf, 8192); printf("Command overhead is %ld usec (time_4096 = %ld, time_8192 = %ld)\n", (time_4096 - (time_8192 - time_4096)) / ITERATIONS, time_4096 / ITERATIONS, time_8192 / ITERATIONS); printf("transfer speed is %g bytes/sec\n", 4096 * ITERATIONS * 1000000.0 / (time_8192 - time_4096)); exit(0); } static int syserror(const char *where) { perror(where); exit(1); } static long timeit(int fd, char *buf, unsigned blocksize) { struct timeval finish; int i; struct timeval start; if (read(fd, buf, blocksize) != blocksize) syserror("read"); if (gettimeofday(&start, (struct timezone *)NULL) != 0) syserror("gettimeofday(start)"); for (i = 0; i < ITERATIONS; ++i) { if (lseek(fd, (off_t)0, SEEK_SET) == -1) syserror("lseek"); if (read(fd, buf, blocksize) != blocksize) syserror("read"); } if (gettimeofday(&finish, (struct timezone *)NULL) != 0) syserror("gettimeofday(finish)"); return (finish.tv_sec - start.tv_sec) * 1000000 + finish.tv_usec - start.tv_usec; }