Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Nov 1995 11:15:34 -0500 (EST)
From:      "Ron G. Minnich" <rminnich@Sarnoff.COM>
To:        Larry McVoy <lm@slovax.engr.sgi.com>
Cc:        hackers@freebsd.org, "William A. Arbaugh" <waa@aurora.cis.upenn.edu>, Theo de Raadt <deraadt@theos.com>, Chuck Cranor <chuck@maria.wustl.edu>
Subject:   larry: you might want to add this to lmbench (but i'm not sure)
Message-ID:  <Pine.SOL.3.91.951110110255.13530A-100000@morse>

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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.3.91.951110110255.13530A-100000>