[PATCH] Stackgap

Robert Watson rwatson at FreeBSD.org
Mon May 30 01:37:57 PDT 2005


On Sun, 29 May 2005, Suleiman Souhlal wrote:

>> 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)?

Have you had a chance to run any micro-benchmarks to confirm all is well?

Also, I thought Poul-Henning's question about the degree of entropy here 
was interesting -- what's the actual scope of possible values?  Are we 
talking about only a small number of offsets (16) or something much 
larger?

I'm not opposed to it being merged as long as (a) we know it doesn't hurt 
us, and (b) it actually does help us.

Robert N M Watson


More information about the freebsd-arch mailing list