Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 May 2005 22:32:50 -0400
From:      Suleiman Souhlal <ssouhlal@FreeBSD.org>
To:        Robert Watson <ratson@FreeBSD.org>
Cc:        arch@FreeBSD.org
Subject:   Re: [PATCH] Stackgap
Message-ID:  <9001CAE4-ECF1-4417-91F3-BAC1FC0A03CE@FreeBSD.org>
In-Reply-To: <20050528150815.X29776@fledge.watson.org>
References:  <CC7E6E83-2C2D-46FF-A816-CAD6F16CDA1B@FreeBSD.org> <20050528150815.X29776@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On May 28, 2005, at 10:10 AM, 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've modified the patch to make sure that the random offset is always  
correctly aligned.. Do you think it would be safe to commit it (maybe  
having the stackgap off by default)?

Bye.
--
Suleiman Souhlal     | ssouhlal@vt.edu
The FreeBSD Project  | ssouhlal@FreeBSD.org




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9001CAE4-ECF1-4417-91F3-BAC1FC0A03CE>