From owner-freebsd-hackers Sun Feb 3 8:59:44 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by hub.freebsd.org (Postfix) with ESMTP id 2F8B437B400 for ; Sun, 3 Feb 2002 08:59:42 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1192) id CD89F10DDF7; Sun, 3 Feb 2002 08:59:41 -0800 (PST) Date: Sun, 3 Feb 2002 08:59:41 -0800 From: Alfred Perlstein To: Michal Mertl Cc: hackers@freebsd.org Subject: stack alignment issues (was: unbelievable benchmark output) Message-ID: <20020203085941.N10817@elvis.mu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mime@traveller.cz on Sun, Feb 03, 2002 at 05:17:21PM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Michal Mertl [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