RFR(L): JDK-8046936 : JEP 270: Reserved Stack Areas for Critical Sections
frederic.parain at oracle.com
Fri Nov 6 15:36:46 UTC 2015
The two "Open Issues" discussed in the JEP are:
- Windows support
- Reserved Stack Area sizing.
Regarding the Windows support, the full feature cannot be
implemented before JDK-8067946 is fixed. I've tried to fix the
Yellow Pages issues on Windows, but all my attempts have failed,
Windows ignoring or overriding my pages management instructions.
If a Windows expert fixes JDK-8067946, we can consider implementing
the full feature on Windows. Even if the Reserved Stack Area
mechanism is not implemented on Windows, the detection of stack
overflow in annotated code sections is supported, which improves
the current situation by making the problem easier to diagnose.
Regarding the sizing, determining the stack space required to
execute a sequence of bytecodes is an incredibly complex task,
due to the number of parameters to consider and the combinatorial
explosion of all the possible combinations. I used an empirical
approach to set the default size of the reserved area with respect
to the code sections currently annotated. I've also implemented
troubleshooting features to detect when stack overflows occur in
annotated sections, which can help determining cases where the
reserved area size is not sufficient.
Regarding the review of the JDK side of the fix, of course it
requires review from jsr166 maintainers. The feature only adds
annotations and doesn't change algorithms or APIs. Note that the
current changesets aim to fix the issue only for ReentrantLocks
but the pattern making the code brittle in case of stack overflow
exists in many other classes of the java.util.concurrent packages.
I'll let core-libs or jsr166 developers decide if more sections
need to be annotated.
On 06/11/2015 08:23, David Holmes wrote:
> Hi Fred,
> Before I look at the code, what is the status of the "Open Issues"
> referenced in the JEP?
> Also the JDK changes need to be reviewed on core-libs-dev and in
> particular must be seen by the jsr166 maintainers (ie Doug Lea and
> Martin Buchholz)
> On 6/11/2015 12:17 AM, Frederic Parain wrote:
>> Please review the changesets for JEP 270: Reserved Stack Areas for
>> Critical Sections
>> CR: https://bugs.openjdk.java.net/browse/JDK-8046936
>> JDK: http://cr.openjdk.java.net/~fparain/8046936/webrev.00/jdk/
>> The CR contains a detailed description of the issue and the design
>> of the solution as well as implementation details.
>> JPRT - hotspot & core
>> RBT - vm.quick
Frederic Parain - Oracle
Grenoble Engineering Center - France
Phone: +33 4 76 18 81 17
Email: Frederic.Parain at oracle.com
More information about the hotspot-dev