From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe)
Subject: Re: Final kick at the "Merced Guessing Game"
Date: 1997/10/14 [thread overview]
Message-ID: <61uvsh$br0$1@goanna.cs.rmit.edu.au> (raw)
In-Reply-To: 61tnd5$6m8@usenet.srv.cis.pitt.edu
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4080 bytes --]
geest3+@pitt.edu (Gregg E Economou) writes:
>You miss the point that while yes, they may be physically multidimensional,
>and even organisationally multidimensional, and even architecturally
>multidimensional, they are *logically* linear, and accessed in a linear
>fashion. Yes, there are strange exceptions out there, but the majority
>of memories are linear int the majorities or architectures and the
>majority of machines ever designed, made, or sold.
With everybody accusing everyone else of missing *the* point,
perhaps it is time to make *a* point.
Today, if you want to write high-performance code on stock hardware,
you have to view your plain ordinary so-called 'linear' address space
as three dimensional.
For example, I am writing this on an UltraSPARC 2.
Level 1 data cache: (The L1 code cache is the same,
16 kbytes I _think_)
32 bytes per line
1-way association
Level 2 cache: (Unified, I _think_)
512 kbytes
64 bytes per line
1-way association
VM
2 Gbytes
8 kbytes per page
Physical memory
512 Mbytes
I've loaned the manual to a student, but if I remember correctly,
latency for load from L1 cache: 3 cycles
latency for load from L2 cache: 8 cycles
latency for load from physical: 30 cycles (if mapped)
latency for load from disc : on the order of 2 000 000 cycles
The machine is four-way superscalar. With well-blocked code working
on data that fits into L2 cache, it isn't very hard to get a floating
add and a floating multiply every cycle. But you simply cannot
sustain that kind of speed on larger amounts of data without taking
the memory hierarchy with extreme seriousness.
I had my first real lesson in memory hierachies back on a Sun 3/50
years ago, where an algorithm that normally did 6000 interesting things
per second suddenly dropped to 6 things per second, thanks to paging.
We fixed that problem by replacing a conventional internal hash table
with a kind of hash table originally designed for data on disc.
There are about 130 processes running on this machine. Perhaps a
more useful indicator is the number of people logged in, which is
about 50 (not counting multiple logins). 512Mb of memory sounds
like a lot, but practically speaking my share is about 10Mb. (About
what you'd get to yourself on a PC with 32Mb of RAM if you shut just
about everything not directly connected with your task down).
If I want to do anything that takes _much_ more than my share of
(physical) memory, I had better design my code very carefully.
'boo' said something about not having to worry about the dimensionality
of memory, and also said something about cache in the same message.
Well, that's another area where it _does_ matter. This machine, like
some others, offers block load and block store instructions. A single
load or store can move 64 bytes. For marching sequentially through
big arrays, it's pretty good, because these instructions don't pollute
the cache, so you can walk through a large array _without_ flushing
stuff you'll want again out of the cache. NIce. But in order to use
those instructions, you have to envisoage your simple linear vector
as an array of 64-byte vectors.
On this machine, think of memory as
an array of 65536 // physical memory
arrays of 128 // pages
arrays of 64 // L2 cache lines (load/store blocks)
bytes
Organising your code to stick with the same small set of 'rows' (cache
lines) wins up to a factor of 4 in memory performance compared with
scattered access.
Organising your code to stick with the same small set of 'planes'
(pages) wins a factor of 10s of thousands in memory performance
compared with scatted access.
The means whereby you access a location is independent of where it is,
but the *cost* certainly isn't. (Oh, and I didn't mention the page
mapping caches! There's another performance knee there, if you don't
watch out.)
--
John �neas Byron O'Keefe; 1921/02/04-1997/09/27; TLG,TLTA,BBTNOTL.
Richard A. O'Keefe; RMIT Comp.Sci; http://www.cs.rmit.edu.au/%7Eok
next prev parent reply other threads:[~1997-10-14 4:00 UTC|newest]
Thread overview: 207+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-10-08 4:00 Final kick at the "Merced Guessing Game" Robert Harley
1997-10-08 4:00 ` William Clodius
1997-10-08 4:00 ` David Chase
1997-10-08 4:00 ` brianh
1997-10-08 4:00 ` boo
1997-10-09 4:00 ` brianh
1997-10-09 4:00 ` Eric Hildum
1997-10-11 4:00 ` Jan Vorbrueggen
1997-10-12 4:00 ` boo
1997-10-13 4:00 ` Carl Perkins
1997-10-13 4:00 ` Michael Williams
1997-10-13 4:00 ` Craig Burley
1997-10-13 4:00 ` boo
1997-10-15 4:00 ` Craig Burley
1997-10-16 4:00 ` Flexible Choice of Language (Nothing to do with: Final kick at the "Merced Guessing Game") Ian Dall
1997-10-16 4:00 ` Craig Burley
1997-10-17 4:00 ` Richard A. O'Keefe
1997-10-17 4:00 ` Keith Adams
1997-10-17 4:00 ` [Reposted due to Enlow UCE cancel]: " John Bayko
1997-10-20 4:00 ` Paul D. DeRocco
1997-10-17 4:00 ` John Bayko
1997-10-18 4:00 ` Kelly Hall
1997-10-20 4:00 ` [Reposted due to Enlow UCE cancel]: " Eric Hildum
[not found] ` <623ek6$ef5$1@news.iastate.edu>
1997-10-16 4:00 ` Final kick at the "Merced Guessing Game" Craig Burley
1997-10-16 4:00 ` SimGraphics
1997-10-17 4:00 ` Craig Burley
1997-10-17 4:00 ` William Clodius
1997-10-19 4:00 ` Craig Burley
1997-10-17 4:00 ` David Chase
1997-10-18 4:00 ` Victor Yodaiken
1997-10-20 4:00 ` Eric Hildum
1997-10-18 4:00 ` Peter L. Montgomery
1997-10-19 4:00 ` Craig Burley
[not found] ` <3456700e.14141203@news.demon.co.uk>
1997-10-28 5:00 ` Dirk van der Knijff
1997-10-20 4:00 ` Richard A. O'Keefe
1997-10-20 4:00 ` Peter L. Montgomery
1997-10-13 4:00 ` Paul Rubin
1997-10-13 4:00 ` Craig Burley
1997-10-13 4:00 ` William Clodius
1997-10-14 4:00 ` Richard A. O'Keefe
1997-10-14 4:00 ` Michael Williams
1997-10-14 4:00 ` Richard Black
1997-10-15 4:00 ` Michael Williams
1997-10-15 4:00 ` Dr. Richard Black
1997-10-16 4:00 ` Richard A. O'Keefe
1997-10-15 4:00 ` Craig Burley
1997-10-18 4:00 ` Bruce Hoult
1997-10-14 4:00 ` Shankar Unni
1997-10-15 4:00 ` Achim Gratz
1997-10-15 4:00 ` Richard A. O'Keefe
1997-10-15 4:00 ` Paul D. DeRocco
1997-10-15 4:00 ` William Clodius
1997-10-15 4:00 ` Joe Buck
1997-10-16 4:00 ` Richard A. O'Keefe
1997-10-16 4:00 ` Craig Burley
1997-10-17 4:00 ` Shankar Unni
1997-10-15 4:00 ` Paul Hsieh
1997-10-09 4:00 ` Gregg E Economou
1997-10-10 4:00 ` Jan Vorbrueggen
[not found] ` <61ho3v$3m0$1@goanna.cs.rmit.edu.au>
1997-10-09 4:00 ` boo
1997-10-09 4:00 ` William Clodius
1997-10-10 4:00 ` Tyson Richard DOWD
1997-10-12 4:00 ` boo
1997-10-13 4:00 ` Steve Tate
1997-10-13 4:00 ` Bernd Paysan
1997-10-13 4:00 ` boo
1997-10-13 4:00 ` Aaron Spink
1997-10-14 4:00 ` boo
1997-10-18 4:00 ` tgg
1997-10-18 4:00 ` [Reposted due to Enlow UCE cancel]: " tgg
1997-10-13 4:00 ` boo
1997-10-13 4:00 ` Victor Yodaiken
1997-10-14 4:00 ` Jason.Ozolins
1997-10-15 4:00 ` boo
1997-10-14 4:00 ` Aaron Spink
1997-10-15 4:00 ` David Chase
1997-10-13 4:00 ` Patricia Shanahan
1997-10-15 4:00 ` boo
1997-10-15 4:00 ` Patricia Shanahan
1997-10-10 4:00 ` boo
1997-10-11 4:00 ` Patricia Shanahan
1997-10-13 4:00 ` Gregg E Economou
1997-10-13 4:00 ` Patricia Shanahan
1997-10-14 4:00 ` Richard A. O'Keefe [this message]
1997-10-15 4:00 ` boo
1997-10-16 4:00 ` Timothy A. Seufert
1997-10-16 4:00 ` boo
1997-10-16 4:00 ` Toon Moene
1997-10-17 4:00 ` Richard A. O'Keefe
1997-10-20 4:00 ` [Reposted due to Enlow UCE cancel]: " tgg
1997-10-20 4:00 ` Jason.Ozolins
1997-10-11 4:00 ` Paul DeMone
1997-10-11 4:00 ` Toon Moene
1997-10-10 4:00 ` Richard A. O'Keefe
[not found] ` <EHrwv9.2w3@world.std.com>
1997-10-10 4:00 ` David Gould
1997-10-10 4:00 ` Maynard Handley
1997-10-11 4:00 ` new languages Preston Briggs
1997-10-10 4:00 ` Final kick at the "Merced Guessing Game" David Gould
1997-10-16 4:00 ` Patricia Shanahan
-- strict thread matches above, loose matches on Subject: below --
1997-10-09 4:00 Robert Harley
1997-10-08 4:00 Robert Harley
1997-10-08 4:00 ` Michael Meissner
1997-10-09 4:00 ` Richard A. O'Keefe
1997-10-08 4:00 Robert Harley
[not found] ` <343C0387.41C6@lanl.gov>
1997-10-08 4:00 ` boo
1997-10-09 4:00 ` David Chase
1997-10-08 4:00 ` boo
1997-10-09 4:00 ` William Clodius
1997-10-09 4:00 ` Patrick Chase
1997-10-10 4:00 ` boo
1997-10-09 4:00 ` David Chase
1997-10-07 4:00 Robert Harley
1997-10-07 4:00 ` Shankar Unni
1997-10-08 4:00 ` boo
1997-10-09 4:00 ` Patrick F. McGehearty
1997-10-10 4:00 ` Richard A. O'Keefe
1997-10-15 4:00 ` David Chase
1997-10-16 4:00 ` William Clodius
1997-10-07 4:00 ` Nick Maclaren
1997-10-07 4:00 ` Martin Rodgers
1997-10-03 4:00 Robert Harley
1997-10-06 4:00 ` Richard A. O'Keefe
1997-10-06 4:00 ` boo
1997-10-07 4:00 ` Richard A. O'Keefe
1997-10-06 4:00 ` Graham Hughes
1997-10-07 4:00 ` boo
1997-10-07 4:00 ` William Clodius
1997-10-07 4:00 ` William Clodius
1997-10-08 4:00 ` Richard A. O'Keefe
1997-10-08 4:00 ` William Clodius
1997-10-08 4:00 ` William Clodius
[not found] ` <y4wwjon203.fsf@mailhost.neuroinformatik.ruhr-uni-bochum.de>
1997-10-08 4:00 ` William Clodius
1997-10-08 4:00 ` Stanley Chow
1997-10-09 4:00 ` William Clodius
1997-10-10 4:00 ` Larry Kilgallen
1997-10-10 4:00 ` Zalman Stern
1997-10-11 4:00 ` Andrew Cruickshank
1997-10-12 4:00 ` Paul D. DeRocco
1997-10-13 4:00 ` Michael Williams
1997-10-08 4:00 ` Gregg E Economou
1997-10-08 4:00 ` David Chase
1997-10-08 4:00 ` Richard A. O'Keefe
1997-10-07 4:00 ` Carlie Coats
1997-10-07 4:00 ` Paul Hsieh
1997-10-07 4:00 ` boo
1997-10-08 4:00 ` Carlie Coats
1997-10-07 4:00 ` Serge Pachkovsky
1997-10-07 4:00 ` Martin Rodgers
1997-10-07 4:00 ` Greg Weeks
1997-10-07 4:00 ` Martin Rodgers
[not found] ` <343AAE5A.A3FCC9D@no.informatik.spam.tu-muenchen.thanks.de>
1997-10-09 4:00 ` Torben AEgidius Mogensen
[not found] ` <EHsr7B.Dt8@bit3.com>
1997-10-10 4:00 ` Torben AEgidius Mogensen
[not found] ` <61cv5e$qn$6@vixen.cso.uiuc.edu>
1997-10-08 4:00 ` William Clodius
1997-10-08 4:00 ` James C. Stutts
1997-10-02 4:00 Robert Harley
1997-10-02 4:00 ` Nick Maclaren
1997-10-03 4:00 ` Richard A. O'Keefe
1997-10-02 4:00 Robert Harley
1997-10-02 4:00 ` Nick Maclaren
1997-10-02 4:00 ` Stanley Chow
1997-09-30 4:00 Paul DeMone
1997-09-30 4:00 ` Guy Harris
1997-10-01 4:00 ` Tom Thornhill
1997-10-01 4:00 ` Richard A. Schumacher
1997-10-01 4:00 ` Tom Thornhill
1997-10-01 4:00 ` Paul DeMone
1997-10-01 4:00 ` Jim Hull
1997-10-01 4:00 ` Nick Maclaren
1997-10-01 4:00 ` Paul DeMone
1997-10-01 4:00 ` J. Corbally
1997-10-01 4:00 ` Nick Maclaren
1997-10-01 4:00 ` Ketil Z Malde
1997-10-01 4:00 ` Michael D. Nahas
1997-10-01 4:00 ` brianh
1997-10-01 4:00 ` Stefan Monnier
1997-10-01 4:00 ` Nick Maclaren
1997-10-01 4:00 ` John Wilson
1997-10-01 4:00 ` P Murray
1997-10-01 4:00 ` Nick Maclaren
1997-10-02 4:00 ` Vesa Karvonen
1997-10-02 4:00 ` Joseph H Allen
1997-10-02 4:00 ` Wilco Dijkstra
1997-10-03 4:00 ` Jason.Ozolins
1997-10-03 4:00 ` Alex Colvin
1997-10-06 4:00 ` Richard A. O'Keefe
1997-10-08 4:00 ` Zalman Stern
1997-10-03 4:00 ` Stefan Monnier
1997-10-03 4:00 ` Stefan Monnier
1997-10-02 4:00 ` Andrew Glew
1997-10-02 4:00 ` Torben AEgidius Mogensen
1997-10-02 4:00 ` Patrick F. McGehearty
1997-10-02 4:00 ` brianh
1997-10-03 4:00 ` Michael Williams
1997-10-01 4:00 ` Allen Kim
1997-10-02 4:00 ` Jon Leech
1997-10-02 4:00 ` Stefan Monnier
1997-10-03 4:00 ` Richard A. O'Keefe
1997-10-03 4:00 ` Mike Smith
1997-10-03 4:00 ` Nick Maclaren
1997-10-03 4:00 ` Rob Barris
1997-10-03 4:00 ` Andrew Glew
1997-10-05 4:00 ` Gianni Mariani
1997-10-04 4:00 ` Nick Maclaren
1997-10-04 4:00 ` H. Eckert
1997-10-05 4:00 ` Andy "Krazy" Glew
1997-10-06 4:00 ` Nick Maclaren
1997-10-02 4:00 ` Eric Hildum
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