From owner-freebsd-arch@FreeBSD.ORG Sun May 29 14:07:57 2005 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 485B416A41C; Sun, 29 May 2005 14:07:57 +0000 (GMT) (envelope-from dfr@nlsystems.com) Received: from itchy.rabson.org (mailgate.nlsystems.com [80.177.232.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id C996743D4C; Sun, 29 May 2005 14:07:56 +0000 (GMT) (envelope-from dfr@nlsystems.com) Received: from herring.rabson.org (herring [10.0.0.2]) by itchy.rabson.org (8.13.3/8.12.11) with ESMTP id j4TE7qoG054378; Sun, 29 May 2005 15:07:52 +0100 (BST) (envelope-from dfr@nlsystems.com) From: Doug Rabson To: freebsd-arch@freebsd.org Date: Sun, 29 May 2005 15:07:49 +0100 User-Agent: KMail/1.8 References: <20050528150815.X29776@fledge.watson.org> In-Reply-To: <20050528150815.X29776@fledge.watson.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200505291507.50289.dfr@nlsystems.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on itchy.rabson.org X-Virus-Scanned: ClamAV 0.83/898/Sat May 28 06:11:03 2005 on itchy.rabson.org X-Virus-Status: Clean Cc: Robert Watson , arch@freebsd.org, Suleiman Souhlal Subject: Re: [PATCH] Stackgap X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2005 14:07:57 -0000 On Saturday 28 May 2005 15:10, Robert Watson wrote: > On Fri, 27 May 2005, Suleiman Souhlal wrote: > > You can find an implementation of stackgap from OpenBSD at http:// > > people.freebsd.org/~ssouhlal/testing/stackgap-20050527.diff > > > > You can control the range of the random stack gap with the > > kern.stackgap_random sysctl. A value of 0 disables it. Otherwise, > > it has to be a power of 2 and not too large. The default value is > > 64K. > > > > I've only had the chance to test this on i386. Could anyone test it > > on other architectures as well? > > > > Any comments/objections? > > In the past, substantial performance hits have been measured due to > poor stack alignment. Specifically, in combination with less optimal > compiler behavior, the results have been pretty nasty. Have you > tried micro-benchmarking a series of runs with this stack offset > randomness using floating point on stack arguments to see if there's > a measurable cost to moving the stack around? Hopefull if all is > well, there will be little or no difference, but a small error here > could result in a substantial performance hit... I recently modified the crt code to force the stack alignment to 16 bytes on startup (so that I could safely write code that uses movaps).