* 21064A D-cache is *KB under Linux (was: lmbench on Linux and DU...) (fwd)
@ 1999-03-11 20:17 B. James Phillippe
1999-03-11 21:43 ` Massmail scripts for Linux Aaron
0 siblings, 1 reply; 3+ messages in thread
From: B. James Phillippe @ 1999-03-11 20:17 UTC (permalink / raw)
To: RedHat AXP list
I saw this on comp.os.linux.alpha and was somewhat intrigued. Can anyone
comment on this?
-bp
--
B. James Phillippe . bryan@terran.org
Software Engineer, WGT Inc. . http://www.terran.org/~bryan
---------- Forwarded message ----------
Subject: 21064A D-cache is *KB under Linux (was: lmbench on Linux and DU...)
Date: 11 Mar 1999 15:51:50 GMT
From: Anton Ertl <anton@mips.complang.tuwien.ac.at>
Newsgroups: comp.os.linux.alpha
In article <7c6ps1$up3$1@prince.dataforce.net>,
Solar Designer <solar@cannabis.dataforce.net> writes:
> Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
> > Bit 12 (DC_16K) of the ABOX_CTL register controls whether the D-cache
> > is 8K (clear) or 16K (set).
I looked at the kernel source (2.2.1), the milo-2.0.30 source, and the
palcode source included with milo-2.0.30. As far as I see the DC_16K
bit is set nowhere.
> > Would simply setting the DC_16K bit be enough? I doubt it; OSs
> > typically need special magic to deal with virtually-indexed caches.
Can anyone comment on this?
> [ Sorry for bringing up a slightly different topic; I think that the
> information below is funny enough, and might be interesting for other
> readers of this newsgroup. ]
Thanks, this inspired me for my solution below.
Your membench.c now gives 1478.98 Mb/sec even with 16K, and our LaTeX
benchmark improves from 32.67s to 31.17s (still some way to go to the
DU result of 24.8s).
- anton
Here's the source code for the module:
/* D-cache control on an 21064A
Just compile it with
gcc -O -c toggle_dc_16k.c
and invoke it with
insmod toggle_dc_16k.o
Never mind the error message. To see the result, invoke
dmesg |tail
which should contain a message like "abox_ctl=0x142c" or
"abox_ctl=0x42c". In the former case, the D-cache now has 16K, in the
latter 8K. Invoke the module again to toggle the state.
When you try to install this module, it toggles the state of the
D-cache between 8K and 16K and then prints the resulting value of the
ABOX_CTL register in hex. If bit 12 (mask: 0x1000) is set, the D-cache
is 16KB, if it is clear, the D-cache is 8KB. The module produces an
error, so it is not installed, but the effect is there nevertheless.
Warnings: It is not clear if Linux handles virtually indexed caches
correctly on a 21064A (there might be problems with cache
consistency, if the same physical page is mapped to several virtual
addresses). It is not clear if it is safe to switch during operation
(this module does not flush the cache).
However, we have experienced no problems during our experiments and
benchmarks with this module (on a non-critical machine:-)
*/
#define MODULE
#define __KERNEL__
#include <linux/module.h>
static long rd_abox_ctl()
{
long abox_ctl;
asm("mov 3, $18; call_pal 9; mov $0, %0": "=r" (abox_ctl): /* no inputs */
: "$0","$16","$17","$18"); /* read abox_ctl register */
return abox_ctl;
}
/* toggle bit 12 of the ABOX_CTL register; this bit controls whether
the Dache is 8KB or 16KB (virtually-indexed in the latter case) */
static void toggle_dc_16k()
{
long abox_ctl;
asm("mov 3, $18; call_pal 9; mov $0, %0": "=r" (abox_ctl): /* no inputs */
: "$0","$16","$17","$18"); /* read abox_ctl register */
abox_ctl^=0x1000;
asm("mov 6, $18; mov %0, $16; call_pal 9": : "r" (abox_ctl)
: "$0","$16","$17","$18"); /* write abox_ctl register */
}
int init_module()
{
toggle_dc_16k();
printk("abox_ctl=0x%x\n",rd_abox_ctl());
return 1; /* device or resource busy, so the module is not installed */
}
void cleanup_module()
{
}
^ permalink raw reply [flat|nested] 3+ messages in thread* Massmail scripts for Linux
1999-03-11 20:17 21064A D-cache is *KB under Linux (was: lmbench on Linux and DU...) (fwd) B. James Phillippe
@ 1999-03-11 21:43 ` Aaron
1999-03-12 2:26 ` Cameron Simpson
0 siblings, 1 reply; 3+ messages in thread
From: Aaron @ 1999-03-11 21:43 UTC (permalink / raw)
To: RedHat AXP list
Short story follows :
A system I administered in the past hired a "consultant". The only
problem is this person erased a a text file that had all the users names
in it. I had a script set up so that a users name was appened to this
file when an account was created, and deleted when the account was
created. Then a REALLY simple script allowed you to mail all the users.
Since this change was done months ago (april 1998) ther are no backups!
NOW I have to come up with another solution, since dumb/cheap consultant
has dissapeared.
Instead of re-inventing the wheel, I'd thought I'd ask if somone has
already done this, parsed the users file and sent mail. If not, I'll do a
perl script and post it to the list, perhaps somone else would need a
hand :)
\--------------------------------------------------------------------------/
\ Aaron Gee AKA Spdracer /
\"Maseratis are more than cars, they are a passion that is understood /
\by some, but enjoyed by a very few" /
\URL---> http://www.italian-cars.com /
\e-mail--> spdracer@america.com Fax-->1 (904) 253 1006 /
\--------------------------------------------------------------/
\ | /
\_|_/
(---)
0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Massmail scripts for Linux
1999-03-11 21:43 ` Massmail scripts for Linux Aaron
@ 1999-03-12 2:26 ` Cameron Simpson
0 siblings, 0 replies; 3+ messages in thread
From: Cameron Simpson @ 1999-03-12 2:26 UTC (permalink / raw)
To: axp-list; +Cc: Aaron
On 12 Mar 1999, in message <Pine.GSO.3.96.990311163845.12741A-100000@enterprise>
Aaron <spdracer@america.com> wrote:
| A system I administered in the past hired a "consultant". The only
| problem is this person erased a a text file that had all the users names
| in it. I had a script set up so that a users name was appened to this
| file when an account was created, and deleted when the account was
| created. Then a REALLY simple script allowed you to mail all the users.
| Since this change was done months ago (april 1998) ther are no backups!
| NOW I have to come up with another solution, since dumb/cheap consultant
| has dissapeared.
|
| Instead of re-inventing the wheel, I'd thought I'd ask if somone has
| already done this, parsed the users file and sent mail. If not, I'll do a
| perl script and post it to the list, perhaps somone else would need a
| hand :)
Assuming your users all have uids over 100 (which is typical):
tr : ' ' </etc/passwd | awk '$3 >= 100 {print $1}'
I have tested that line and it's a good first cut towards rebuilding your file.
--
Cameron Simpson, DoD#743 cs@zip.com.au http://www.zip.com.au/~cs/
After all, he thought he was God. - FBI agent on why it was difficult
to negotiate with David Koresh
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1999-03-12 2:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-11 20:17 21064A D-cache is *KB under Linux (was: lmbench on Linux and DU...) (fwd) B. James Phillippe
1999-03-11 21:43 ` Massmail scripts for Linux Aaron
1999-03-12 2:26 ` Cameron Simpson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox