From owner-freebsd-hackers Fri Nov 10 08:17:52 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id IAA01258 for hackers-outgoing; Fri, 10 Nov 1995 08:17:52 -0800 Received: from terra.Sarnoff.COM (terra.sarnoff.com [130.33.11.203]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id IAA01245 for ; Fri, 10 Nov 1995 08:17:45 -0800 Received: from section05 (morse.sarnoff.com [130.33.10.158]) by terra.Sarnoff.COM (8.6.12/8.6.12) with SMTP id LAA24699; Fri, 10 Nov 1995 11:16:02 -0500 Received: by section05 (5.x/SECTION05-Client) id AA13590; Fri, 10 Nov 1995 11:15:34 -0500 Date: Fri, 10 Nov 1995 11:15:34 -0500 (EST) From: "Ron G. Minnich" To: Larry McVoy Cc: hackers@freebsd.org, "William A. Arbaugh" , Theo de Raadt , Chuck Cranor Subject: larry: you might want to add this to lmbench (but i'm not sure) Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org Precedence: bulk this program does a very simple thing: 1) open a file 2) call write with an invalid address, viz: write(fd, x, 5); where x is (void *) 0x40000000 it does this as many times as you ask. What it's measuring is correlated to the raw performance of the system's ability to look up a vm region or segment or object given a virtual address. It is not a pure measure, since systems that do a lot of work before checking the arguments (freebsd) will fare worse than systems that just check the arguments up front for validity (linux). On the other hand, all the system calls that happen a lot have to do this operation, so you probably want this type of thing to be fast. Numbers ( i just do wall clock time, since to first order it's all system) linux, p100, 3.8 seconds Irix, 150 Mhz. r4600 63 seconds Solaris, 66 Mhz. sparc-20 68 seconds FreeBSD, p90 290 seconds Yup, freebsd is really basically 70 times slower than linux on this one. And yup, linux really does do this in 40 ticks -- not bad. It's probably the fact that linux checks it first and gets the work out of the way, but i'm not sure why freebsd has to be so slow. I'm willing to blame it on the mach vm, since it has been such a problem in so many other ways. Should we tell arpa :-)? I'm willing to be convinced this is a lousy general-purpose benchmark. For some work i'm doing it is measuring an important value however. But if you can tell my why it is fatally flawed i'm willing to listen. Thanks! ron #include #include main(argc, argv) int argc; char *argv[]; { int fd; void * x; int i; int count = 1; int debug = 0; if (argc < 2) { printf("usage: %s file-to-create [count [debug]]\n", argv[0]); exit(1); } fd = open(argv[1], O_RDWR|O_CREAT, 0777); if (fd < 0) { perror(argv[1]); exit(1); } if (argc > 2) count = atoi(argv[2]); if (argc > 3) debug++; printf("created %s ", argv[1]); x = (void *) 0x40000000; for(i = 0; i < count; i++) if (write(fd, x, 5) > 0) printf("if did not fail!\n"); perror("one illin"); } Ron Minnich |Like a knife through Daddy's heart: rminnich@sarnoff.com |"Don't make fun of Windows, daddy! It takes care (609)-734-3120 | of all my files and it's reliable and I like it".