From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,59ca3b26f2b9f750 X-Google-Attributes: gid111c93,public From: Solar Designer Subject: Re: lmbench on Linux and DU, explanations welcome Date: 1999/03/10 Message-ID: <7c6a9r$pr3$1@prince.dataforce.net>#1/1 X-Deja-AN: 453462430 References: <7c36ao$fnm$1@news.tuwien.ac.at> <7c50a1$btd$1@prince.dataforce.net> <7c633v$b$1@news.tuwien.ac.at> Organization: DataForce ISP User-Agent: tin/pre-1.4-980226 (UNIX) (Linux/2.0.36 (i686)) Newsgroups: comp.os.linux.alpha Anton Ertl wrote: > ... >> > However, it seems unlikely to me that this is the explanation for the >> > differences in the 8K-16K range. So, my questions are: >> >> Isn't there a 50% chance of the two pages (or are there three, if the Actually, that is assuming a uniform distribution, which we probably don't get. >> array isn't page-aligned?) getting mapped onto physical addresses >> corresponding to the same half of the cache? > For a direct-mapped physically indexed cache, yes. What is the > organization of the L1 cache in the 21064A? One web page I read > claimed it is virtually indexed, which would mean that the physical > page mappings should be irrelevant (except maybe for inclusion in L2). I've just found another web page, which lists 21064A as physically indexed: Processor level size line assoc wp index fow coher ------------------------------------------------------------------------------ DEC Alpha 21064A L1 16k 32 1 WT->L2 PIPT no http://www.dcs.warwick.ac.uk/~john/cache-specs.html The right way to find out for sure (well, almost) would probably be to download the PDF from Digital/Compaq and read. > I have made ten runs on Cabriolets under Linux (you can find runs from > another machine with and without 512K cache in > http://www.complang.tuwien.ac.at/anton/a4.ps.gz). They all have the > step at 8K, not at 16K. The chance of this happening in ten runs by > chance is 0.1%. Not necessarily; the page mapping might depend on things such as the size of your binary's sections, which remain the same over the runs. >> While I don't have a good explanation, let me offer a simple benchmark >> I did a while ago: >> >> ftp://ftp.dataforce.net/pub/solar/membench.c And also an old proof-of-concept program for detecting L1 data cache size and associativeness (actually, in the opposite order): ftp://ftp.dataforce.net/pub/solar/cache.c The code is a bit dirty, but seems to work most of the time (there're a few exceptions though, such as under a high load). For example, on my 21164PC, it reports: L1 data cache: 8 Kb, direct-mapped and on a Pentium II: L1 data cache: 16 Kb, 4-way associative both seem correct. :-) > Here's what I got (results in MB/s read bandwidth): > size Linux DU > 1K 1497.11 1466.47 > 4K 1519.95 1538.94 > 7K 1494.72 1488.24 > 8K 1509.16 1490.77 > 9K 858.61 1492.08 > 15K 362.99 1515.74 > 16K 344.40 1516.17 > 17K 344.65 1069.26 > I.e., we get the same picture as with lmbench. The results under > Linux look as if the machine had only 8K L1 D-cache, whereas under DU > we get full L1 bandwidth up to the full 16K of the L1 D-cache. Yes. It does indeed look like Linux doesn't use the full cache; I guess it might be time to check the PALcode. How are you booting Linux? Are you using the correct MILO image, if any? -- /sd