Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Feb 2002 08:59:41 -0800
From:      Alfred Perlstein <bright@mu.org>
To:        Michal Mertl <mime@traveller.cz>
Cc:        hackers@freebsd.org
Subject:   stack alignment issues (was: unbelievable benchmark output)
Message-ID:  <20020203085941.N10817@elvis.mu.org>
In-Reply-To: <Pine.BSF.4.41.0202021843210.5132-100000@prg.traveller.cz>; from mime@traveller.cz on Sun, Feb 03, 2002 at 05:17:21PM %2B0100
References:  <Pine.BSF.4.41.0202021843210.5132-100000@prg.traveller.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
* Michal Mertl <mime@traveller.cz> [020203 08:17] wrote:
> I wrote a simple program which does this:
> 
> gettimeofday
> something (takes several seconds)
> gettimeofday
> print time elapsed
> 
> Several runs of the program take about the same time but the time
> changes wildly when the executable is called differently.
> 
> -------
> ./xx/xxx
> 5 s
> xx/xxx
> 9 s
> 
> and similar. It holds true on vastly different machines with current and
> stable.
> 
> The only thing which I can think of that can be causing this is some
> memory alignment issue.

It sure looks like an alignment issue.  If you print the address
of 'i' and 'j' in the attached program you can see for the fast
case they are aligned to 8 byte boundries, but when it's slow they
are at an address that is a multiple of 4 but not 8.

Not really sure what to make of this, anyone else know how we ought
to fix this?

-Alfred


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020203085941.N10817>