From owner-freebsd-arch@FreeBSD.ORG Sat May 28 14:10:05 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 2346C16A41F; Sat, 28 May 2005 14:10:05 +0000 (GMT) (envelope-from ratson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [204.156.12.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id D03C943D54; Sat, 28 May 2005 14:10:02 +0000 (GMT) (envelope-from ratson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by cyrus.watson.org (Postfix) with ESMTP id 6F2CA46B3F; Sat, 28 May 2005 10:10:02 -0400 (EDT) Date: Sat, 28 May 2005 15:10:12 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Suleiman Souhlal In-Reply-To: Message-ID: <20050528150815.X29776@fledge.watson.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: arch@FreeBSD.org 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: Sat, 28 May 2005 14:10:05 -0000 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... Robert N M Watson