Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Oct 1995 07:15:43 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        dennis@etinc.com, hackers@freebsd.org
Subject:   Re: VLB Disk Controllers
Message-ID:  <199510072115.HAA03150@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>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 <sys/types.h>
#include <sys/time.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>

#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;
}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510072115.HAA03150>