| Subject: Re: P4 Hyperthreading/Improving cache usage |
| From: "Michael D. Ober" <obermd.@.alum.mit.edu.nospam> |
| Date: 01/09/2004, 04:28 |
"Martin 53N 1W" <ml_news@ddnospamddml1dd.co.uk.dd> wrote in message
news:pv4Zc.157$4q5.90@newsfe1-gui.ntli.net...
Mike W wrote:
Please post me a link if this has been covered before!
If you are running two copies of Seti on a HT Pentium, I believe that
they are seen by Windows as being two separate images, since you have
to run each one in its own directory. This means that they use two
separate chunks of cache memory, leading to potentially lower
perfomance if the cache gets full.
Has anyone found a way of letting Windows know that you want to use
two copies of the /same/ program, therefore allowing both copies to
share cache memory contents where appropriate?
[...]
Nice idea but I don't know of any OS that supports this at the CPU cache
level.
Actually, since Windows shares read-only executable images in memory and
each process has a private table that translates the virtual addresses to
the same physical addresses, it is very likely that the CLI's code will be
in the L2 cache and be shared by both instances. This only works if the
image is from the save .EXE file. As a general rule, SETI Driver only uses
a single CLI executable. The Windows Task Manager doesn't show this,
however. Windows does other performance tricks such as not writing
read-only pages to the swap file. Instead, it simply discards them and then
re-reads them back from the original location on disk, thus saving a disk
write when the EXE's physical memory is needed for other processes or data.
I assume that all modern OS's, including Linux, do this as well.
I doubt anything like that will get supported either. Intel's 'HT' is
likely a very short lived design 'workaround' for attempting to balance
out the bottlenecks in their P4 CPU architechture.
Dual core CPU designs date back to the 1970s with the IBM System 370. This
is a tried and true design for boosting performance without increasing power
consumption and heat generation. Also, earlier this year Intel scrapped
further development of high performance single core processors - they were
starting to consume too much power and generate too much waste heat.
The nearest you'll get is at the main memory level. There is the linux
'fork' and unix 'vfork' mechanisms that run two processes from the one
copy of code held in memory. This might help the CPU cache with fewer
misses for small routines.
Not being a Linux person, I assumed Linux could do this but it's nice to
know how. You can do this same in Windows simply by using the same .EXE for
your multiple instances. SETI Driver takes advantage of this by only
keeping one copy of the CLI around and reusing it. SETI Driver's in-place
execution is actually based on the ability of Windows to launch a program
that resides in a different directory from the "application default
directory". SETI Driver simply starts each instance of the CLI with the
appropriate "application default directory".
rem - a batch language example of the above; uses absolute paths for
illustration.
cd "c:\Program Files\SETI Driver\1"
start /b "c:\Program Files\SETI Driver\setiathome-winnt-3.0.3.exe
cd "c:\Program Files\SETI Driver\2"
start /b "c:\Program Files\SETI Driver\setiathome-winnt-3.0.3.exe
In this case, the first application default directory is "c:\Program
Files\SETI Driver\1" and the second application default directory is
"c:\Program Files\SETI Driver\2", but the application resides at the level
above and it's physical memory image is mapped into both processes. The
"start /b" starts the process without a window. (SETI Driver contains a lot
more intelligence when selecting the numbered subdirectory for each process
and isn't simply a round robin.)
Nice idea!
SETI Driver implements this idea by taking advantage of the memory
management design in Windows.
Note, this is not a Linux bashing post. It is simply a clarification of
what Windows is capable of doing if you know the OS's execution model.
Mike Ober.
http://www.wakeassoc.com/setidriver
Good luck,
Martin
--
---------- OS? What's that?!
- Martin - To most people, "Operating System" is unknown & strange.
- 53N 1W - Mandrake 10.0.1 GNU Linux
---------- http://www.mandrakelinux.com/en-gb/concept.php3