RFC: 8139864: Improve handling of stack protection zones. (original) (raw)

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Mon Oct 19 07:35:31 UTC 2015


Hi,

I opened this issue because I think the lower bounds for StackRedPages, StackYellowPages and StackShadowPages introduced in 8078556 cause problems on systems with page sizes > 8K.

For a more detailed description of the problems to expect see https://bugs.openjdk.java.net/browse/JDK-8139864.

I see a row of possible solutions to this.

1.) Just set the lower bounds to '1'. That's what I proposed before. I can imagine setups where one wants to reduce the size of these zones to a minimum. If an application starts a lot of threads, and is known not to overflow stacks, this might be desirable to save memory.

2.) Implement constraint methods that assure the zones never get smaller than DEFAULT_STACK_*_PAGES * default_page_size. This is necessary if you want to make sure the zones never can get smaller than that.

3.) Introduce new flags StackRedZoneSize, StackYellowZoneSize and StackShadowZoneSize. Set the default values to those of StackRedPages 4K etc, which is the most common page size I guess. During startup, round these to page size. Use StackZoneSize in the code. If StackPages flags are set on the command line, convert them to StackZoneSize by multiplying with the current page size.

I'm happy to make a webrev for the favored solution.

Best regards, Goetz



More information about the hotspot-runtime-dev mailing list