Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Nov 2002 14:38:15 -0800
From:      David Schultz <dschultz@uclink.Berkeley.EDU>
To:        Don Bowman <don@sandvine.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: stack alignment, XEON / P4
Message-ID:  <20021110223815.GA3927@HAL9000.homeunix.com>
In-Reply-To: <FE045D4D9F7AED4CBFF1B3B813C8533701022EC7@mail.sandvine.com>
References:  <FE045D4D9F7AED4CBFF1B3B813C8533701022EC7@mail.sandvine.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake Don Bowman <don@sandvine.com>:
> In sys/conf/kern.mk, there is a comment about not aligning
> the (x86) stack to 16-byte boundaries, and it overrides the 
> preferred-stack-boundary to 2.
> 
> .if ${MACHINE_ARCH} == "i386"
> CFLAGS+=        -mno-align-long-strings -mpreferred-stack-boundary=2
> .endif
> 
> This seems to be contradicted by intel's optimisation guide
> for the P4/XEON family.
> 
> It seems that the performance is best by making it 4, even for
> older chips.
> 
> Is there any hidden pitfall to changing this value? I compiled
> a kernel, and all seems to run ok.

I believe it was changed because GCC 2.95 was horribly broken with
respect to alignment.  It wouldn't generate incorrect code, but it
would waste stack space and emit many extraneous alignment
instructions.  GCC 3 does a much better job, so perhaps the
alignment should be reverted to GCC's default.

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?20021110223815.GA3927>