Subject: Re: Squid on Alpha blows up..
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: Andrew Brown <atatat@atatdot.net>
List: port-alpha
Date: 03/03/1999 11:41:15
> > in both cases, the processor is able to access the value, but when the
> > value is aligned, the alpha can read or write it 30 times faster than
> > when it is not.
>
>Actually...
>
>The processor _ITSELF_ is not able to!  It does, in fact, generate an
>unaligned access fault.  The _KERNEL_ fixes up the access.  This is
>VERY slow:
>
>	(1) Overhead of taking an unaligned access fault.
>
>	(2) Overhead of fixup.
>
>	(3) Additional overhead for (2) because access must be across
>	    a protection boundary.

i expected as much.  but didn't know any better.  but i had just read
something where someone quoted something that seemed applicable, so i
threw it into a conversation about which i know very little.  :)

thanks for the info.

>For this reason, we trap the unaligned access fault, and do one of 4
>things, depending on sysctl variables:
>
>	(1) Silently fixup the unaligned access.
>
>	(2) Print out a message and fixup the unaligned access.
>
>	(3) Silently send the process a SIGBUS.
>
>	(4) Print out a message and send the process a SIGBUS.

hmm.  sigbus or not and message or not.  so processes on alphas don't
get sigbus'ed at all (modulo the sysctl setting)?  would it
"theoretically" be possible to do the same thing for other
architectures?  i'm just curious...

>Also note that the NetBSD kernel will panic if unaligned access is
>performed by the kernel, rather than by a user process.

certainly.  to where would it trap?

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."