From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,f9dc4c274aad13e4 X-Google-Attributes: gid111c93,public From: naddy@mips.rhein-neckar.de (Christian Weisgerber) Subject: Re: Why is our Alpha box so slow? Date: 1998/08/03 Message-ID: <6q55em$a58$1@mips.rhein-neckar.de>#1/1 X-Deja-AN: 377663246 References: <6pv2mq$17v$1@mips.rhein-neckar.de> X-Server-Date: 3 Aug 1998 20:09:58 GMT Newsgroups: comp.os.linux.alpha 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 bytes of memory in a *p++ +=1 loop for 15s and count iterations. You'd expect that if 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 #include #include #include #include #include /* 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: