Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Feb 2004 01:26:49 +0100
From:      Thomas Moestl <tmm@freebsd.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: FreeBSD 5.2 v/s FreeBSD 4.9 MFLOPS performance (gcc3.3.3 v/s gcc2.9.5)
Message-ID:  <20040217002649.GA5185@timesink.dyndns.org>
In-Reply-To: <xzpn07i28u3.fsf@dwp.des.no>
References:  <BAY12-F37zmBUw7MurD00010899@hotmail.com> <20040214082420.GB77411@nevermind.kiev.ua> <xzpvfm8yssm.fsf@dwp.des.no> <200402160352.16477.wes@softweyr.com> <20040216035412.GA70593@xor.obsecurity.org> <xzpn07i28u3.fsf@dwp.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2004/02/16 at 19:11:16 +0100, Dag-Erling Smørgrav wrote:
> Kris Kennaway <kris@obsecurity.org> writes:
> > On Mon, Feb 16, 2004 at 03:52:16AM -0800, Wes Peters wrote:
> > > Should I commit this?
> > What effect does it have on non-i386 architectures?
> 
> It can't possibly hurt.  If the stack is already aligned on a "better"
> boundary (64 or 128 bytes), it is also aligned on a 32-byte boundary
> since 64 and 128 are multiples of 32, and the patch is a no-op.  If
> only a 16-byte alignment is required, a 32-byte alignment wastes a
> small amount of memory but does not hurt performance.  I believe that
> less-than-16 (and possibly even less-than-32) alignment is pessimal on
> all platforms we support.

Well, it misaligns stack_base on 64-bit architectures, for example
(notice the "- 4", which is there to compensate for the fixup in
kern_execve() that will subtract another sizeof(register_t)):

	vectp = (char **)(((vm_offset_t)vectp & ~(vm_offset_t)0x1F) - 4);

It would by much better to be able to align the stack in
exec_setregs(), like amd64, ia64, powerpc and sparc64 do.
Unfortunately that would require changes to crt1, so it would pose a
compatibility problem.

	- Thomas

-- 
Thomas Moestl	<t.moestl@tu-bs.de>	http://www.tu-bs.de/~y0015675/
		<tmm@FreeBSD.org>	http://people.FreeBSD.org/~tmm/
"Oh, great altar of passive entertainment... Bestow upon me thy
 discordant images at such speed as to render linear thought
 impossible!"					-- Calvin and Hobbes



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