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: anton@mips.complang.tuwien.ac.at (Anton Ertl) Subject: Re: lmbench on Linux and DU, explanations welcome Date: 1999/03/10 Message-ID: <7c6jsp$97o$1@news.tuwien.ac.at>#1/1 X-Deja-AN: 453515492 References: <7c36ao$fnm$1@news.tuwien.ac.at> <7c50a1$btd$1@prince.dataforce.net> <7c633v$b$1@news.tuwien.ac.at> <7c6a9r$pr3$1@prince.dataforce.net> Organization: Institut fuer Computersprachen, Technische Universitaet Wien Newsgroups: comp.os.linux.alpha In article <7c6a9r$pr3$1@prince.dataforce.net>, Solar Designer writes: > Anton Ertl wrote: > The right way to find out for sure (well, almost) would probably be to > download the PDF from Digital/Compaq and read. I did that. The document is http://ftp.digital.com/pub/Digital/info/semiconductor/literature/21064ads.pdf It says on page 11, that there are two modes of using the D-cache: as 8K direct mapped cache; and as 16K cache that appears internally as virtually-indexed direct-mapped cache; externally (I guess this means for cache consistency bus snoops) it appears as 2-way set-associative cache. The manual has a funny way of spelling "virtually-indexed": "Virtual address [13] and physical address [12:5] are the index into the cache." Bit 12 (DC_16K) of the ABOX_CTL register controls whether the D-cache is 8K (clear) or 16K (set). I bet that our Cabriolets run in 8K-D-Cache mode. > 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. :-) On a Cabriolet under DU this gives: L1 data cache: 16 Kb, direct-mapped Looks right. On a Cabriolet under Linux this gives: L1 data cache: 8 Kb, 4-way associative Hmm, let's try another run: L1 data cache: 8 Kb, direct-mapped Another run, same result. More runs, various results:-( Back to ZDU, varying results. On a 21164A this program produces [a5:~/ftp:1001] a.out Working... L1 data cache: 32 Kb, 2-way associative [a5:~/ftp:1002] a.out Working... L1 data cache: 32 Kb, 2-way associative [a5:~/ftp:1003] a.out Working... L1 data cache: 64 Kb, 4-way associative Maybe it needs a little more work:-) > 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? We are booting ARC->MILO->Linux, and we use a Cabriolet MILO. Would simply setting the DC_16K bit be enough? I doubt it; OSs typically need special magic to deal with virtually-indexed caches. - anton -- M. Anton Ertl Some things have to be seen to be believed anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen http://www.complang.tuwien.ac.at/anton/home.html