Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: naddy@mips.rhein-neckar.de (Christian Weisgerber)
Subject: Re: Why is our Alpha box so slow?
Date: 1998/08/03	[thread overview]
Message-ID: <6q55em$a58$1@mips.rhein-neckar.de> (raw)
In-Reply-To: 6pv2mq$17v$1@mips.rhein-neckar.de

Some further details:

Today I checked the hardware. The CPU clock is jumpered correctly to
233MHz. There are eleven -1024-20 cache RAMs and the cache speed jumper
is set to the 20ns position. Looks okay to me.

The box boots with MILO. It was originally shipped with a console for NT
but the flash ROM has since been overwritten with MILO.

I'm told the machine needs about 2..3h to compile a kernel. I haven't
yet managed to build one, so I haven't verified this value.

I have written a very simple program in an attempt to evaluate the
memory bandwidth of the machine. Yes, it's primitive, but I didn't have
a proper benchmark at hand. (Any pointers?) Basically all it does is run
through <size> bytes of memory in a *p++ +=1 loop for 15s and count
iterations. You'd expect that if <size> fits into the cache, there'll be
more iterations.

On my Pentium-100, 256k PB cache (FreeBSD 2.2.7, gcc 2.7.2.1, -O3), I
get the expected result:

   1k:    185500888     *
   2k:    185921817     *  8k 1st level cache
   4k:    186118297     *
   8k:    184412946     *
  16k:    158454103     .
  32k:    158543035     .
  64k:    158442354     .  256k 2nd level cache
 128k:    158063623     .
 256k:    157281569     .
 512k:    123673105
1024k:    123498417        main memory
2048k:    123463409
4096k:    123659481

The result on the Alpha box (Red Hat 5.1, 2.0.33, egcs-2.90.29, -O3) is
bizarre:

   1k:    149679693     *
   2k:    149316456     *  8k 1st level cache
   4k:    144773425     *
   8k:    144881972     *
  16k:    104659487     .
  32k:    104677115     .
  64k:    104652525     .
 128k:    104110833     .  huh!? we have 1M
 256k:     56204479        of 2nd level cache
 512k:     40814057
1024k:     32698979
2048k:     26571787        continuously getting slower!?
4096k:     24232887


Here's the program, to be run on an unloaded machine.

--------------->
/*
 * test memory bandwidth
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>
#include <sys/time.h>

/* MUST be powers of two and multiples of sizeof(int) */
#define MINMEM	1024
#define	MAXMEM	(4096*1024)
#define RUNTIME	15		/* seconds per iteration */
#define WORD	long

char *progname;
int  run;

void handler(int sig)
{
  run = 0;
}

int main(int argc, char *argv[])
{
  long  i, count;
  WORD *buf, *p;
  struct itimerval it;
  
  progname = rindex(argv[0], '/');
  if (progname == NULL)
    progname = argv[0];

  buf = malloc(MAXMEM);
  if (buf == NULL) {
    fprintf(stderr, "%s: can't allocate memory.\n", progname);
    exit(1);
  }

  setvbuf(stdout, (char *)NULL, _IOLBF, 0);
  it.it_interval.tv_sec = 0;
  it.it_interval.tv_usec = 0;
  it.it_value.tv_sec = RUNTIME;
  it.it_value.tv_usec = 0;
  for (i = MINMEM; i <= MAXMEM; i <<= 1) {
    p = buf;
    run = 1;
    count = 0;
    signal(SIGVTALRM, handler);
    setitimer(ITIMER_VIRTUAL, &it, (struct itimerval *)NULL);
    while(run) {
      *p++ += 1;
      if (p >= buf + i / sizeof(WORD))
	p = buf;
      count++;
    }
    printf("%4ldk: %12ld\n", i/1024, count);
  }

  exit(0);
}
<---------------

-- 
Christian "naddy" Weisgerber                  naddy@mips.rhein-neckar.de
    100+ SF Book Reviews: <URL:http://home.pages.de/~naddy/reviews/>



  parent reply	other threads:[~1998-08-03  4:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-01  4:00 Why is our Alpha box so slow? Christian Weisgerber
1998-08-01  4:00 ` Paul Tomblin
1998-08-01  4:00 ` B. James Phillippe
1998-08-03  4:00   ` Eric Christy
1998-08-03  4:00   ` Christian Weisgerber
1998-08-05  4:00     ` B. James Phillippe
1998-08-01  4:00 ` Greg Lindahl
1998-08-03  4:00   ` Christian Weisgerber
1998-08-02  4:00 ` Carlos Vidal
1998-08-03  4:00 ` Christian Weisgerber [this message]
1998-08-04  4:00   ` Christian Weisgerber
1998-08-04  4:00   ` Linus Torvalds
1998-08-04  4:00     ` Robert Harley
1998-08-06  4:00     ` Christian Weisgerber
1998-08-14  4:00     ` bmeyer
1998-08-04  4:00   ` Chris Pirih, proverbs at wolfenet dot com
1998-08-05  4:00     ` David A Willmore
1998-08-12  4:00       ` Chris Pirih, proverbs at wolfenet dot com
1998-08-06  4:00   ` B. James Phillippe
1998-08-06  4:00   ` Alex Rhomberg
1998-08-06  4:00     ` Christian Weisgerber
1998-08-06  4:00     ` Robert Harley
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox