From owner-freebsd-hackers Sun Nov 10 14:38:18 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7B63F37B401 for ; Sun, 10 Nov 2002 14:38:17 -0800 (PST) Received: from HAL9000.homeunix.com (12-232-220-15.client.attbi.com [12.232.220.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id D42C743E42 for ; Sun, 10 Nov 2002 14:38:16 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id gAAMcGDN003993; Sun, 10 Nov 2002 14:38:16 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id gAAMcFjk003992; Sun, 10 Nov 2002 14:38:15 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Sun, 10 Nov 2002 14:38:15 -0800 From: David Schultz To: Don Bowman Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: stack alignment, XEON / P4 Message-ID: <20021110223815.GA3927@HAL9000.homeunix.com> Mail-Followup-To: Don Bowman , freebsd-hackers@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thus spake Don Bowman : > 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